Questions tagged [url]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
13
votes
6answers
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" ...
1
vote
1answer
41 views

Migrating custom routes from v2 to v3

I have a handful of custom routes configured on this project like 'action/(?P<custom_id>[a-zA-Z][0-9]{6})/(?P<slug>.*)' => 'action/_member', If I'm reading the docs correctly, then ...
0
votes
0answers
21 views

Include Field in URL

Looking for a way to include a field value in a section URL. Is this possible? It appears to work but always shows 'default' rather than the field value.
0
votes
0answers
16 views

How to get category/entry url and a category url in entry breadcrumbs

I have entries for a channel called ‘resources’ that are related to multiple resource categories. When I call the category specific resource entries in a index, how can I get the url of website/...
1
vote
2answers
85 views

How to remove something from the slug/url

I got entries in the folder /cms/web/videos/ and the url display this: http://domainname.com/cms/web/videos/barco-auro. I want it to be this: http://domainname.com/videos/barco-auro. How do I create ...
1
vote
0answers
11 views

Section URI format deprecation error

I'm using the following URI format of a channel {slug}-{restaurant.one().slug}-{locations.last().slug}-{locations.one().slug} It throws a deprecation error caused by locations.last() however when I ...
2
votes
2answers
57 views

Change entries URL?

In ExpressionEngine was a URL field under the title field that was filled when writing the title. It was possible to change the URL to something else. Also if i want to change the title of an entry ...
3
votes
2answers
2k views

Using pagination on a page with url with query string data

I have an index page that filters entries based on url query strings, eg: site.com/inductees?county=123. I put together a very simple pagination setup with next/prev links. However, when I click "...
1
vote
1answer
34 views

URL routing with types

We need to setup following URL: DOMAIN/{lang}/{family}/offers/{slug} e.g.: example.com/en/Larsen/offers/example What do we need to configure our section URL? Have anyone an idea?
1
vote
0answers
68 views

How to get url from related entry in another site

I'm relating entries from another site in my installation, and I'm having issues getting the correct URL for the entry. This is an example of what I currently have: {% set carouselEntries = entry....
1
vote
1answer
40 views

How to load entries data in the General Configuration file?

I'm trying to set dynamic paths for values such as activateAccountSuccessPath. This kind of code below from my routes.php file works very well: use craft\elements\Entry; $myAccount = Entry::find()-&...
1
vote
1answer
35 views

How I’ll get an entryId based on a given URL?

I want to configure deeplinks for an app and want to set up 'universal links'. Right now I'll send an entry id to the element api to get the right content. But with universal links I didn't have a ...
31
votes
1answer
8k 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?
1
vote
1answer
35 views

Filter by slug from URL (advanced)

Channel: Restaurants Channel: Nutrition / contains entries field named restaurant. Required URL format: restaurant-name-nutrition since the URL structure is merged I can't use getSegement(x) ...
2
votes
1answer
850 views

Asset (image) public URL does not work

I wanted to include some uploaded assets (images) in an entry. The .url property in twig outputs the proper URL, in my case: http://localhost/craftcms/web/image/photo-2017-04-02-16-20-53-1.jpg ...
2
votes
1answer
41 views

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

How to make URLs translatable in Craft 3

I am trying to make the URLs translatable according to the language selected for the site.
1
vote
1answer
32 views

Using language specific variables inside section URL settings

When i use some kind of variable in url settings of section, it always uses default language version of this variable. For example, blog has two languages, english (default) and german. If i use ...
1
vote
3answers
232 views

How do I get rid of “web” in URL?

I have been all over the docs page and various other topics across the web on this, and nothing seems to solve it for me. It's probably something obvious, but I am stuck. I recently installed Craft 3 ...
1
vote
1answer
322 views

How do I get different URL Format with parent/child structures & how do I display different templates?

I need to create a features structure section for a website that will have parent features and child features. Q1: How do I get different URL Format for parent & child pages? I need the parent ...
2
votes
1answer
2k views

If page conditions

I have an {% include%} which displays entries from a structure. This {% include%} is displayed on the homepage and other entries throughout the site. On the homepage, I'd like the include to show a ...
23
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}...
1
vote
1answer
61 views

Query for entry related to current entry in section URI settings

My entries within specific section can be related to each other using "Entries" field. If entry1 "Entries" field is filled with entry2, i want to entry2 url look like this: entry1/entry2 How can ...
1
vote
2answers
46 views

Resolve url from inside template

Can I resolve full URL to some object - entry or category, from inside Twig template? Mind you, I don't mean searching for something by slug, but by full URL. So, for example, instead of passing '...
3
votes
3answers
1k views

redirect index.php in urls on Craft site to NEVER show index.php

We’ve recently had some issues with a staging site being down and it turned out the reason for this was: In the words of Brad at Pixel and Tonic, the redirect is "intercepting the update request for ...
1
vote
0answers
33 views

Use sequential numbers for entry slug

I have a channel where I need each entry's URI include the year and then a sequential number, like this: 2018/1/ 2018/2/ 2018/3/ 2019/4/ I have no problem getting the year, but is there a way to get ...
5
votes
2answers
948 views

Get the Category name into the URL for an entry

I have a gallery which is categorised. The gallery is a Structure section where the user adds an entry and then assigns it to a category - all good. At the moment, when clicking on an entry title the ...
1
vote
2answers
39 views

URL Structure - advise and thoughts of best approach?

I am currently building a website for Hot Tubs and within this there will be New Tubs, Used Tubs and Hire Tubs (each will be a top level page on the navigation, and each tub will have a details page). ...
1
vote
2answers
289 views

How can I use the entry UID in the entry URI

The entries in my Craft app need a unique ‘non-guessable’ URL, so I figured I could use the UID in the URI of the entry. So in the section, where I need to provide the URI format I entered "section-...
2
votes
1answer
98 views

404 when clicking on the Disqus embed urls

I've just noticed on a site that the Disqus comment embed is suggesting other articles but they're adding a token to the end of the URL, for example: http://australia.thegospelcoalition.org/article/...
1
vote
2answers
109 views

Advanced routing

I am trying to do this. Have a structure url like so: /{id}-{slug} and /{parent.id}/{id}-{slug} I need the slug on the url but I only for SEO, I want craft to ignore the slug and only go for the ID. ...
1
vote
1answer
53 views

Locales and links not working as intended

I have taken over a project and Im having a small problem with locales. It is running Craft 2.6.3016 A section has a locale “en” where the english URL format is “en/contact”, and the entry also have ...
1
vote
1answer
200 views

Element-API: Access the first url of an asset array

I have an asset field in my current project with the handle postImage, containing multiple image files. In my element-api endpoint, I wish to access the url of the first file only. I tried the ...
2
votes
1answer
1k views

Nginx: index.php URLs still being served alongside pretty URLs

For whatever reason https://domain.com/index.php?p=path/to/whatever and https://domain.com/index.php/to/whatever both still work and are not being redirected or rewritten to https://domain.com/path/to/...
1
vote
0answers
21 views

Craft 3: Prevent craft adding script filename to URLS

I'm running Craft 3 with multi-site. Working well so far, but my hosting doesn't allow me to create traditional vhosts with their own directories and shared upper filesystem. As such I have an ...
2
votes
1answer
110 views

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

How can I set a landing page for a structure with no slug?

In Craft2, I have structures that each have a landing page/homepage for that structure. If the structure's URI format is "liver/{slug}", how do I make the 'landing page' entry have a URI of only "...
1
vote
1answer
206 views

Point a plugin into to a local file

This should have been easy. But, I am dorking something up. I am trying to point FeedMe to a local file. In Finder, the file is located under /Users/shellyar/Desktop. I also tried `file:////Users/...
1
vote
1answer
65 views

How can I manually update the URI of an entry?

Is there a way to manually change the URI for an entry? for instance where is this stored in the database (is it?) I need to update one that is: /vacancies to /vacancies-1444 for example the 1444 ...
1
vote
1answer
328 views

Is it possible to include category slugs in the entry URL format?

Is it possible to include category or tag slug in the entry URL format? Would you please let me know the tags that make it, if possible?
1
vote
2answers
149 views

Structure entry position in url

Is it possible to include the entry position (Structure) via the Entry Type Title Format? This is the current format: published in {postDate|date('F')} {postDate|date('Y')} which renders: published-...
2
votes
2answers
102 views

Change posts url without losing SEO positioning

I migrated a site with over 500 posts from Wordpress to Craft 2.6 recently but came across this problem: the WP site used to set post's urls as https://mysite.com/{slug} while the new blog is (...
1
vote
1answer
31 views

Adding multiple slashes after the site URL breaks the current entry, but still loads the template

I've come across an issue where typing the URL e.g www.sitename.com///about will still load the about template, but not fill the page with the content. Is this an issue for google finding the ...
0
votes
1answer
56 views

How can I use two different templates for a single entry?

I'm building a coursework site and have a Course section, who's entries will be courses containing work that the client will assign to users. I built in both the work itself (different "lessons" ...
8
votes
1answer
2k views

How do I add a subcategory to the URL slug for a channel entry?

I'm trying to mimic the URL structure exactly how I have it in my old CMS. If I select an entry to have both a category and subcategory I would like to have the subcategory in the URL along with the ...
1
vote
1answer
379 views

Get the section name based on a url segment

I'd like to retrieve the name of a section based on a url segment. Normally I would use {{entry.section.name}}, but this doesn't work, since there is no entry available. I've got this working: {% ...
1
vote
1answer
139 views

Include the URL of a related entry field

I would like to add the URL of the channel entry I have selected (atm 2 channels are available to choose from), so I would like a url like: summerhouses/product1 or greehnouses/product2 how would ...
1
vote
2answers
120 views

404 error if folder in public_html has same name as folder in craft/templates

I am currently transfering a live website to Craft CMS. I am trying to keep all URLs of pages and images exactly the same as the live version, because of all the pages and images cached in Google. ...
1
vote
1answer
75 views

Force Anchor ID into page URL

I'm trying to add tabs into my Craft Site and have just noticed that when you add an anchor point, the anchor ID doesn't actually show up in the URL as it would a normal site, however I need this ...
1
vote
1answer
785 views

Craft 3 with Multi-Site: how to not set a primary site, or add a first segment to all primary site URLs?

I have a main domain, www.mycompany.com, which has several groups of sites, which are available in several languages: www.mycompany.com/international www.mycompany.com/sales/en www.mycompany.com/...