Questions tagged [url]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
8
votes
1answer
11k views

Fetch Image URL from entry CMS

This seems like it should be really simple. I set the field for an image asset, linked it to the entry type I want it associated to, and then uploaded the image in the cms to the folder I specified. ...
1
vote
2answers
1k views

Can't remove index.php without getting a 404, .htaccess redirect not working, why?

So this is not my first craft build, and basically, it's identical to my last setup on the craft front, I can't see anything wrong, but I can't remove index.php without causing a 404. I've tried the ....
1
vote
0answers
210 views

Performance and cache when using entry type templates and getSegment

I'm working on a site that will end up having 30-40+ structure sections which are sharing templates and will be using about 10 different entry types. (This would probably be much easier if I used ...
7
votes
3answers
3k views

URL rewrite not working

For some reason the CraftCMS URL rewrite is not working on GoDaddy shared hosting server. Currently by .htaccess file looks like this Options +FollowSymLinks -Multiviews <IfModule mod_rewrite.c&...
0
votes
1answer
200 views

getUrl using my original develpment server domain

I have the following code and after moving site to a live server, the img src is using the old domain, however, the anchor links have correct domain name. Any idea what the issue is? ...
5
votes
1answer
919 views

Output URL to section

Is it possible to output the path to a given section? I'm using this to define the section model for the contact page (a single): {% set contactPage = craft.entries.section('contact') %} But then, ...
2
votes
2answers
1k views

What's the best way to link to an entry in a template?

I have the following code and I'm looking for the best way to link to another entry page. <a href="#" class="btn-quote">request a quote</a> I tried something like this with no luck: <...
2
votes
2answers
624 views

How to set a different URL format for each entry type of a section?

Is there any way to set a different url format for each entry type of a section? I have an entry type "image" on which I will be using the Randomm plugin by Fred Carlsen to generate random strings ...
1
vote
1answer
197 views

Craft URLs intermittently being cached as /index.php/my-page/ or /index.php?p=my-page

Cross-posting from here, as I'm not sure if this is a Craft issue or specific to the cache-clear plugin. Intermittently (twice in a day now), I've seen templates being cached with Craft URLs ...
3
votes
1answer
7k views

How do I properly set assets paths?

I'm having a problem getting my asset URLs to print properly in templates. The site is using a multi-environment configuration (dev/stage/live) with localized content (en/es/da) and shared assets. ...
2
votes
2answers
595 views

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 created:...
2
votes
1answer
838 views

Matrix Entry URL Link

Trying to create a page link to entries and can't figure out how to do it. Here's what I have. It's just outputting the title, but not the url. Specifically, I'm talking about {{ block.pageLink....
1
vote
2answers
804 views

Using a user’s full name in the URL

I like to have the user’s full name in their profile page-url rather than the username in case they don’t want their username associated with their full name. In my case they don’t get to set the ...
4
votes
1answer
1k views

How to grab the full URL in a plugin?

When writing a plugin is there a Craft request to grab the entire url? I want to grab everything including http://domain.com/uri preferably without writing my own function. I see getUrl but craft()-&...
3
votes
1answer
2k views

Get parameters from referrer

Is there a way to get the parameters from the referrer url? I've tried this: {{ craft.request.urlReferrer.getQuery }} but that’s not working.
3
votes
1answer
2k views

Update and add POST URL parameters

How do you add extra parameters or update a parameter to an exiting POST URL? ADD EXTRA PARAMETER For example, I have a page at this address: http://localhost/shop/?color=red&order=title And ...
7
votes
1answer
1k views

How to use url segments like with Freebie in EE

I'm trying to make the jump from EE to Craft but struggling in this area (and thinking I may be approaching this all wrong). In EE, I often use url segments (in combination with Freebie to ignore ...
3
votes
1answer
3k views

URL Format of a nested structure with 3 or more layers

I have a nested Structure with 3 layers like so: Home Services Service A Sub Service A Sub Service B Service B About Us Contact Now I would like the nesting to be reflected in the URL like so: ...
3
votes
1answer
800 views

multi-environment config for {siteURL} not working

I've got a multi-environment setup working well for my database - that was easy to setup and i've had no issues getting it to work. Now i'm trying to set the siteUrl as a multi-config variable and no ...
3
votes
1answer
292 views

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 ...
1
vote
1answer
2k views

How should I setup my .htaccess file

I want to point any domain.com/page to the www.domain.com/page without showing index.php in my urls. I have a www and non-www A record pointing to an IP address. How do I set up my .htaccess file ...
3
votes
1answer
207 views

Is there any downside to using localized characters in urls?

I'm working on a site with both english and spanish locales. Crafts localization features have been awesome so far, and I've been embracing Craft's ability to easily localize URLs. For example, if I ...
1
vote
1answer
2k views

URL validation without http:// or https:// in the URL

Is is possible to use Craft's URL validation without http:// or https:// in the URL? Or use some sort of function / filter to conditionally add it to the URL if it is missing? I'm posting a form ...
3
votes
1answer
645 views

Compose URL POST parameters to filter entries by category?

How do you update an URL with new params? I'm working on a search / filter entries page. I have multiple menu lists with categories in it. Like this: Size: Small Medium Large Color: Blue Red White ...
2
votes
2answers
2k views

How to redirect an entry's URL to a specific URL?

Say I have a custom field "URL" for each entry and I want them to be redirected to these specific URLs instead of Craft's. Similar to WordPress "Page Links To" plugin. http://wordpress.org/plugins/...
3
votes
1answer
2k views

How do I get get clean URLs in twig templates

When I use {{page.link}} or {{page.url}} in a template I am getting http://mysite.dev/index.php?p=pages/about/history when what I really want is http://mysite.dev/pages/about/history The latter ...
2
votes
2answers
241 views

Pages for each entry from an entry type?

Let's say I have an entry type named "Designers", and I have: A title field "Full Name" A categories field "Specialty" Another categories field "Location" Now I want each designer (that is, each ...
1
vote
1answer
342 views

Channel URL Format leads to 404s for individual entries

I've broken my news channel but I don't know how I did it, or consequently to fix it. If one clicks on 'I just installed Craft' or 'Continue reading', it will take you to the URL I specified in the ...
7
votes
1answer
872 views

Using an IF-statement to define the Entry URL Format

Within a channel I have two kinds of possible article types, which I separate with the entry type feature. For the entry URL format I want to include the type, but only for one of the two. I've tried ...
3
votes
1answer
2k views

Is it possible to add an entry value to the entry URL Format?

I try to compose an entry URL for artists pages with first name and last name. Now: artists/{slug} = artists/{{ entry.title }} {slug} = {{ entry.title }} = Artist Last Name What I want to add at ...
9
votes
1answer
4k views

Method to grab URL hash in Twig or craft.request?

Is there a method or recommended way of grabbing URL hash parameters with Twig? For example, if my URL is http://mysite.com/my-page#hash, is there a way to grab the hash?
2
votes
1answer
255 views

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}/{...
4
votes
1answer
199 views

Make “original” images unaccessable?

Is it possible to make the uploaded "original" images unaccessable for site visitors and make only the transforms public? I'd like to upload images in full quality, to get the best possible quality ...
6
votes
1answer
2k views

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 ...
4
votes
1answer
2k views

Installing Craft in sub directory

I need to install Craft under a laravel sub-directory http://example.com/corp/ where example.com is a laravel site. Does anyone have a clean way to install craft in a directory below an existing app?...
24
votes
4answers
7k views

Add home page to a structure?

I am using a structure for all of my site's pages (single pages and channel index pages). The structure settings are as follows: URL for Top-Level Entries: {slug} URL for Nested Entries: {parent.uri}...
4
votes
2answers
3k views

CSS is not loading on staging server

I'm quite new to server config, so this might be a simple mistake. I have a local environment setup on my computer that works just fine. I uploaded my project to my staging server at AWS and the only ...
9
votes
2answers
4k views

How would I include the first category slug in the section's entry URL format?

I have a custom section that uses routes like this: /section/category/entry_url In trying to program the search form results I realized that I need to explicitly define the entry URL format for the ...
3
votes
2answers
520 views

How to persist locale in site navigation?

I've got a bi-lingual site running nicely, /en/news/news-item displays the English version and /cy/news/news-item displays the Welsh version. Great! I can't figure out how to get the URLs for the ...
4
votes
1answer
254 views

Should I pluralize a channel's index slug?

Lets say I have a channel called places, which has the following URL : http://example.com/places The url points to a directory of individual places. However, when you click into an entry, each ...
10
votes
2answers
5k views

How can I convert text into a URL-friendly string?

If I want to convert text into a URL friendly string for sharing text in a social media link, how would I go about that?
6
votes
1answer
419 views

How automatic slug generator could replace accentuated letters?

When typing in the title, the automatic slug generator doesn't filter or replace accentuated letters such as (ő, ú, á, ű). Is there a way to replace these letters to the unaccented one (like ő -> o, ű ...
3
votes
1answer
742 views

URI / Slug auto generation limitation

Craft seems to have a limitation when generating unique URI for > 100 entries with the same title..... I have a channel with YouTube videos in and some are spread across 140 parts all with the same ...
6
votes
2answers
984 views

How do I get a random entry's URL from a Entries field?

I have a Entries field and I'd like to return a URL for one randomly picked entry. I could loop through all the entries, but I'd like to do something more efficient. Can I return an array of URLs? Or ...
17
votes
4answers
12k views

301 Redirects Appends ?p=original/url/path - how can I remove?

Whether I'm using the Reroute plugin or plugging it in .htaccess, changing the path elsewhere appends the query in the end. How can I remove? Redirect 301 /blog/category /blog/archive Is the line I ...
32
votes
1answer
9k views

What’s the recommended way to set the site URL?

There are multiple ways to set the site URL. What is the recommended way?
3
votes
1answer
2k views

How do I make site links relative?

To get around a temporary issue where two urls go to the same site, I wanted to set all my site links to be relative rather than using the full url. Looking through the Craft docs I found that it's ...
4
votes
1answer
585 views

Best practice on how to hand over variables with links?

You sometime want to pass specific info from one page to another. How do you do that with twig and are there explicit Craft methods to do this? Can you do this without exposing the variable in the ...
13
votes
5answers
6k views

Image transforms returning cpresources url

I'm trying to get Craft to render an image transform defined in the control panel. No image is added to the "filelocation/_transformhandle" folder and returns the url "/cpresources/transforms/98" ...
9
votes
3answers
3k views

Entry Types Custom Slug

The website I'm working on has different sections and each section different types of entries. I would like the types of entries to be shown in the URL. I have followed this tutorial to do so. In a ...