Questions tagged [slug]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
44 views

Product URL missing category slug on production site

I upgraded a Craft CMS 3 site to version 4. The Product URI Format for my products look like this: Before I re-save a product, the URL displays correctly the way it looked in Craft 3: But when I re-...
nitech's user avatar
  • 679
1 vote
1 answer
142 views

How do I generate a slug based on another field?

Is it possible to somehow generate a SLUG not from the title field, but, for example, from your own created field? Example: A website for analyzing complex mathematical solutions. Each entry in the ...
Dimi's user avatar
  • 273
1 vote
1 answer
88 views

How to get list of pages where the asset is used?

I have a list of assets link with assets id. eg: 23453 => 'https://some_cool_domain/assets/file_name.jpg' I need to find all the pages where this asset is being used. I am new to craftcms. I tried ...
Suman Bhandari's user avatar
2 votes
1 answer
150 views

Export related entries by slug - not id

I am using the included exporter tools in Craft. I am trying to export content from a preprod to a production env. When I export content from preprod, I noticed that related element (entries, ...
emilie zawadzki's user avatar
1 vote
1 answer
169 views

DOM hash url in entry slug

I try to set the slug of an entry to a url using a hash. https://url.spec.whatwg.org/#dom-url-hash However it seems not possible by default, craftcms changes the hash to a dash. I need that as ...
Honsa Stunna's user avatar
1 vote
1 answer
393 views

Special Characters in Slugs

I need to output a slug that will include characters like < and |. I realise that these can't be literal, so I had hoped to be able to swap them out for the URL encoded equivalents. For example, ...
theAdhocracy's user avatar
1 vote
1 answer
139 views

nested sections

how can i achieve the following result? i have a structured section called products like /hardware/apple/iPhone which gets the template /templates/productpage.twig now i need need to load a different ...
Nick Langer's user avatar
1 vote
1 answer
41 views

Error accessing entry when title has special characters

I came across a weird bug with a title containing a "%" character not converting into a proper slug. So the website editor created the title "Berlenga: a 100% sustainable island" ...
Frederico Leonardo's user avatar
0 votes
0 answers
167 views

Internal Server Error when updating slug

I'm getting an internal server error when I try to update the my entry's slug on prod, but not on dev or locally. It's happening across entries, it doesn't seem to be specific to a certain entry. Any ...
Lisa's user avatar
  • 1
1 vote
1 answer
74 views

Can slug and title changes be propagated to multiple sites?

I'm noticing that if I change the title or the slug of an entry after creation, that change isn't propagated to my other Craft sites. Is there a way to propagate title and slug like other fields?
weotch's user avatar
  • 155
0 votes
0 answers
236 views

How to allow multiple entries to have the same slug?

Users create an account and their profile (domain.com/userName) is a template pulling info from craft users. Each user can create entries, all stored in a Structure section (domain.com/userName/...
Rich Holt's user avatar
0 votes
0 answers
54 views

Commerce product slug creates duplicates - can they also be autogenerated?

The slug for products is generated from the Title, for example in my case "Green Shirt". Seems like these are not unique, and if I create a product later on, also called "Green Shirt", they both get "...
Carl-Johan's user avatar
1 vote
1 answer
168 views

Allowing duplicate slugs in category paths

Again, I've had a look online but couldn't figure out what I had to do. Say I've got a category structure like the below: Category 1 Saturday Sunday Category 2 Saturday Sunday How can I allow ...
zigojacko's user avatar
  • 135
2 votes
1 answer
120 views

Use of duplicate slugs, without -1

Is there a way/workaround for using "duplicate" slugs? Example: shop.com/candy (category page with listing of candy's) shop.com/about-us/candy (plain page with info about the production process etc)...
Romberto's user avatar
1 vote
2 answers
749 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 ...
Sebastiaan Schillebeeckx's user avatar
0 votes
0 answers
57 views

How can I sync slugs within sites in the same Group?

I have a Craft site with approx. 13 Sites. They are grouped by language, e.g. German has Germany and Austria in it. Spanish has Spain and Mexico in it. I imported all content to the main groups ...
Laurence Cope's user avatar
1 vote
1 answer
89 views

How to make a multiple route?

Can't figure out how to create a dynamic route for the categories in this format: site.com/news/category-1-and-category-2-and-category-3 That would bring the results from these slug categories. ...
lolipop's user avatar
  • 11
1 vote
3 answers
2k views

How to change an entry's slug on EVENT_AFTER_SAVE_ELEMENT?

My entries' titles are auto-generated from several fields values on first save. When one of these fields values change, I would like to update the auto-generated slug also: Event::on( \craft\...
Romain Poirier's user avatar
2 votes
1 answer
146 views

How to set index page as parent of a structure

I don't know if it's possible, but what I would like is to have a structure with 3 levels linked to a single entry that would act as the index. The problem is the examples I've seen are only with 1 ...
Tyrannogina regina's user avatar
1 vote
1 answer
143 views

Same content on different slugs

I hope someone can help me to understand this. I have a Channel called eg. "My channel". In that channel i have two entries: Post 1 and Post 2. Those two entries have different titles and content. ...
Joe's user avatar
  • 79
1 vote
0 answers
50 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 ...
artmem's user avatar
  • 1,012
1 vote
1 answer
320 views

Limit slugs to ASCII for auto-generated titles

I currently have auto-generated titles that contains accents and so does the slugs. Since the slug is used to generate assets folders, accents aren't suitable and results in question marks in the ...
fdelaneau's user avatar
  • 123
1 vote
1 answer
555 views

Could not find a unique URI for this element

Suddenly, I can't add any entry to a structure. When I try to save a record, I've got "Could not find a unique URI for this element“. Although, the slug is perfectly valid and unique, but whatever I ...
scandella's user avatar
1 vote
1 answer
179 views

Channel entry: Slug from field pattern?

I have defined an entry for a channel, let's say of persons, to have some fields, let's say firstname, lastname and bio, but no title. When I created the first real entry, craft complained it had no ...
Urs's user avatar
  • 639
2 votes
1 answer
209 views

Matrix Field Slug Output

I am not sure why, but I cannot seem to get the short name/handle/slug of a matrix field that is a category field. I need to get it's slug. {% for row in entry.matrixField %} {{ row.matrixChild....
Vin's user avatar
  • 373
1 vote
1 answer
68 views

call matrix entries

I set up a form structure with a matrix. Now I would like to call the entries one by one. My first idea was to loop through them, but the outcome is that the entries are displayed alltogether. Then ...
analog junkie's user avatar
1 vote
1 answer
89 views

Categories Structure for Landing Pages

I'm using a category group and routes to serve up entries on landing pages with a URL structure like this. www.domain.com/properties/retail/freestanding My code works, but I am wondering if there's ...
triplethreat23's user avatar
1 vote
1 answer
667 views

Unable to update slug in Craft 3 for single enteries

I have created some entries for type single but now I am not able to update their slug even I have updated the title
Kantesh Hotchandani's user avatar
1 vote
2 answers
189 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. ...
Evangelos's user avatar
1 vote
2 answers
448 views

How to point a static url to a file

I have a field "menu card" in my globals' section "menuCard", so I could access my file in the template with menuCard.menuCard.first().url. That is fine, but when the editor changes the menu-card file ...
Michael's user avatar
  • 137
1 vote
1 answer
421 views

Bulk regenerate slugs

I’ve already got a ton of content put in by the client, and there’s quite a bit of accented characters (é, à, ...) in the titles, and thus also in the slugs where they get url encoded, which my client ...
mrsmn's user avatar
  • 721
1 vote
1 answer
393 views

Dynamic Subfolder Paths - folder does not exist even after updating asset directories in settings

I have an asset directory which is set to {basePath}assets/images/products/ I know my basePath is right as it works on other asset sources. My entry upload location for products is set to: {slug}/...
ToddPadwick's user avatar
1 vote
1 answer
121 views

Category slug variable is not available when category url's are disabled

Just like the title states, the slug variable is not available when a category's url are disabled: <select name="field-styles" id="field-styles" class="select"> <option value="">Style&...
Siebird's user avatar
  • 373
1 vote
1 answer
647 views

Do slugs absolutely have to be unique?

I know Craft appends slugs with -1 if they already exist but I'm working on an app where the addition makes things awkward for us (we have to match the slug to a third-party service). I was under the ...
Clive Portman's user avatar
2 votes
1 answer
1k views

Auto generating slug with custom fields or ID

I'm not sure I've seen this exact question, but I'm curious how I can include custom and/or auto-generated parts of a slug. It's not the URI creation, but the slug itself. For Instance: {slug}-{id} ...
John Johnson's user avatar
2 votes
1 answer
63 views

Receive all used slugs

I want to create a Excel file with all used slugs in my Craft website. I've searched for a plugin but without succes. I also tried to find a useful table in the Craft database, also without succes. ...
Mr. Sam's user avatar
  • 287
1 vote
1 answer
2k views

How to change the Slug in case of copied entries?

I have a channel, where entries do NOT have their own URLs. But a slug is created automatically every time I save an entry. And I have auto-generated titles. Often I save an existing entry as a new ...
MISC's user avatar
  • 1,009
1 vote
1 answer
147 views

Possible to have a single entry page with multilingual slugs and only one index.html?

How can I be able to have a single section page (so that clients can't create another one of this) that only needs 1 index.html template across different languages AND be accessible through following ...
mdmngz's user avatar
  • 157
1 vote
1 answer
231 views

Getting only slug in otherwise null object on routed template

I'm trying to create a template route that allows me to get all of the attorneys that I've related to a specified practice area. I can get the slug easily, as my route looks like this: 'attorneys/...
Christopher Kennedy's user avatar
1 vote
1 answer
39 views

How to make a code/settings for accessing the one database from 2 different html files with {slug}

I create a code for TV show database, but I have a big problem. Please see the image I want to access one entry(post) with some data from some templates. But I don't know how to create any code or ...
tetsujikenny's user avatar
2 votes
1 answer
399 views

Can I use a structure without slugs?

I'm making a portfolio website, where the url's look like "projects/project-name". There is also an overview page with all the projects that is under "projects" on itself. I'm using a Structure for ...
Arne Van Kauter's user avatar
1 vote
1 answer
100 views

Can I give every structure entry a custom layout by using the same template?

I want every structure entry to have a follow up page, http://thisismysite.com/handle/slug/followuppage. So every slug, get a follow up page with different content but the same template. Is there a ...
Bodil Seekles's user avatar
2 votes
2 answers
824 views

Multiple URL Formats per element type (Entries, Categories)

I suspect this boils down to a feature request, but I'll start here in case there are any other ideas. Basically, I want to be able to define multiple URL formats for a single section or category ...
Tim Kelty's user avatar
  • 3,071
2 votes
1 answer
462 views

Best solution for articles tag page?

I've been looking through the forum, it seems there's a few methods to retrieve a tags page but I'm looking for the most efficient method (both speed- and template-wise). Using tag.name with tag ...
Rob's user avatar
  • 865
2 votes
1 answer
218 views

Entry slug auto appends -1 even when the original slug is unique

I have an entry slug like this: cics-west-belden-1 the -1 seems to be auto appended to the slug, but there are no other entries with the project cics-west-belden in my project. When I remove the -1 ...
ChaiTea's user avatar
  • 95
3 votes
1 answer
707 views

Error: URI already taken

I've got a content type for team members but whenever I try to add one it gives me an error saying "the URI 'team' has already been taken". I assume the URI is made from the slug, which is where I ...
Mosh's user avatar
  • 153
2 votes
1 answer
1k views

Twig: Show specific entry by url

my url looks like this: domain.tld/slug-1/slug-2/variable And in Twig it shall look for an entry with the slug slug-1 and show it, then an entry with the slug slug-2 and show it and look up for a ...
mstoldt's user avatar
  • 57
1 vote
1 answer
1k views

Custom URL based on Categories

I am very new to this CMS and I was able to set it up, import some content from csv files. I have set up templates and right now if someone clicks on the article, the URL is www.example.com/articles/{...
Subrato M's user avatar
  • 109
2 votes
1 answer
505 views

Can't rename slug

Each time I try to rename a slug within an entry, the page refreshes, but the slug is getting a -1 appended. The slug I want is: forms. The slug I get after saving is: forms-1. I've checked through ...
Matt Ellis's user avatar
2 votes
1 answer
1k views

Multilingual slug setup

I'm setting up my first multilingual website with Craft. I'm struggling with multilingual slugs. This is how I'd like the slugs to look like. If I do this tough, I need to adapt my folder structure. ...
Marco Schuler's user avatar