Questions tagged [url]

279 questions
6
votes
1 answer

Dynamically setting a channel's Entry URL Format with Craft tags

I have a Structure section and a Channel section. Entries in the Channel will be listed on one of the Structure Entries, and it's entry page will fit the same URL format. So for example, the Structure Entry may be: Title: "Our People" URL:…
Jamie Pittock
  • 1,511
  • 11
  • 15
4
votes
2 answers

URL Redirect Not Working

Seems like I can't get the base install URL to work. To get Craft to show posts I have to format the URL as, /public/index.php?p=news/2015/we-just-installed-craft Instead of just the /news/2015/we-just-installed-craft I think the .htaccess is…
3
votes
1 answer

How to localise page url

in a multilingual site, how can i place multilingual links to content. i.e. in the footer i would place a Imprint but in anohter language the slug might be /de/germanImprint...is there an easy helper to always get the right url from the english…
nexflo
  • 539
  • 4
  • 13
2
votes
1 answer

Another index.php?p= problem

I can't get rid of that pesky index.php?p= from my urls. http://mysite.com/index.php?p=about/people If I manually remove index.php?p= e.g. http://mysite.com/about/people it works, but then goes back to adding the index.php?p= as soon as I navigate…
Samsull
  • 151
  • 3
2
votes
1 answer

How to Make getURL Output Complete URL (rather than root relative)

I'm using getURL() as follows in my Craft template: {% set sharingImageURL = entry.sharingImage[0].getUrl('socialMedia') %} Every time the output is a root relative URL and I'd like it to be a complete URL (including http://www.mydomain.com). I…
dpayne
  • 659
  • 6
  • 14
2
votes
1 answer

How do I build a link from variables?

I'm building an entry type's menu, automatically populated with several sections. A route for dynamic menu had to be also created. Code {% set section = craft.sections.getSectionByHandle('sectionHandle') %} {% set entryTypes =…
Dominik Krulak
  • 1,562
  • 14
  • 27
2
votes
1 answer

Entries field in categories URI

Is there a way to pass value of an entries field into category URI format? {% if object.level == 1 %} {slug}-{entries.one().slug} {% else %} {slug}-{parent.uri} {% endif %} Thanks.
Mark H.
  • 391
  • 2
  • 15
2
votes
1 answer

How to create clean URLs for category strings?

This code for linking to a category page: href="/products/?category={{ category.slug }}" Generates this URL: www.website.com/products/?category=category-name Can someone please tell me how to code links in menus (etc) that will produce URLs…
MGX
  • 479
  • 1
  • 5
  • 12
2
votes
2 answers

How to auto-generate URLs in Craft?

How to auto-generate URLs in Craft? For example when we upload images on Tumblr, an URL to the post is created: http://twotimeselliott.tumblr.com/post/95032257420 And an URL for the image is…
rey
  • 97
  • 6
2
votes
2 answers

Can Craft convert requested url to lowercase?

I think this is normally done with .htaccess or httpd.conf, but it's a bit cumbersome on shared hosting, and it seems like a simple trick for a CMS... Can Craft convert requested URLs to lowercase? So if the slug for the page is /meditate, but…
kr37
  • 1,355
  • 9
  • 18
2
votes
1 answer

Can the Entry URL Format of a Channel intersect with the Entry URL Format of a Structure?

Can the Entry URL Format of a Channel intersect with the Entry URL Format of a Structure? For example I have a Structure like this- Top-Level Entries: products/{slug} Nested Entries: {parent.uri}/{slug} Can a Channel Entry URL Format be set so that…
user1070143
  • 1,106
  • 12
  • 24
2
votes
2 answers

Does it make sense to use Craft with relative links?

A coworker of mine asked me if I could make the links in Craft relative. Which is not a big deal for navigation links, relative url: {% set relativeUrl = entry.url|replace((siteUrl), '/') %} but it gets trickier for links inside a Rich Text…
Marco Schuler
  • 620
  • 3
  • 13
1
vote
1 answer

Whats the best way to create short URL's

I have a client that wants to create a short URL to an entry for a mail shot. What would be the best way to do this. I have the Reroute plugin installed which would work (setting to a 302 redirect) but I am wondering if that is the best approach.
Gareth
  • 1,605
  • 2
  • 14
  • 35
1
vote
1 answer

if entry has same url segment

I have a Structure that has the URL setup like this.. Top-Level Entries - {slug} Nested Entries - {parent.uri}/{slug} How do I list all entries that have the same segment1 of their URL as to what is on the current page the user is on. i.e if I am…
ljm
  • 141
  • 1
  • 8
1
vote
1 answer

How to automatically rename image uploads?

How to automatically rename the image files to a random string during the upload process? For example, I have an image named "big_poster.jpg" and I want it to be saved as something random, for example "2680542675157_cc7m541v_l.jpg" I see every…
rey
  • 97
  • 6
1
2