Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [slug]

The tag has no usage guidance.

1
vote
0answers
13 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 ...
1
vote
1answer
16 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 ...
1
vote
1answer
21 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 ...
1
vote
1answer
18 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 ...
0
votes
0answers
26 views

Changing Slug to Custom Field

I currently have an entry section called Brands which automatically saves with a custom Title field automatically generated using the following settings: {{ object.brandShortname }} Promo Codes & ...
2
votes
1answer
60 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....
1
vote
1answer
34 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 ...
1
vote
1answer
37 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 ...
1
vote
1answer
90 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
1
vote
2answers
74 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
2answers
57 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 ...
1
vote
1answer
66 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 ...
0
votes
0answers
58 views

set slug from entry in custom field as a variable

My products have a custom field that allows the client to assign a 'designer' entry to it. (each designer has their own article page) I then need to use the slug from these 'designer' entries, to ...
1
vote
1answer
134 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}/...
1
vote
1answer
49 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&...
1
vote
1answer
270 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 ...
2
votes
1answer
304 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} ...
2
votes
1answer
42 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. ...
1
vote
1answer
528 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 ...
1
vote
1answer
84 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 ...
1
vote
1answer
103 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/...
1
vote
1answer
36 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 ...
2
votes
1answer
108 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 ...
0
votes
0answers
249 views

How can the get the slug of the top level structure to be `/`

I'm currently setting up Craft 2 using locales to serve as multiple sites. The primary content is in a structure of pages. I have a single top level page that I want to serve as the home page for a ...
1
vote
1answer
68 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 ...
2
votes
2answers
513 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 ...
2
votes
1answer
234 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 ...
2
votes
1answer
108 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 ...
4
votes
1answer
393 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 ...
2
votes
1answer
535 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 ...
1
vote
1answer
477 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/{...
2
votes
1answer
123 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 ...
3
votes
1answer
652 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. ...
4
votes
1answer
102 views

.relatedTo() not returning tags with spaces

I think I'm seeing a bug while using advanced search with relatedTo(). If I use a simple search, like this: {% set param = { order: 'RAND()', limit: null, search: "#{request.tags}" } %} It ...
0
votes
2answers
65 views

How to utilize unique slugs for plugin elements that extend the BaseElement class

I have my slug saving to the element_i18n table but it's not unique. When saving a non-unique slug using the default Craft entries, the slug gets appended with "-1". How can I extend the default ...
3
votes
1answer
280 views

Include related entry slug in URl

I've got a channel named "locations" that has an entry fieldtype which allows me to select the corresponding store/brand (limited to 1). How can I define the slug of the related entry in Entry URL ...
2
votes
1answer
336 views

Setting an entry slug from a pluign

I have a plugin where I'm creating custom entries based on user submitted data. Saving these entries works well. As does modifying their titles after saving to add the entry's ID to the title (using ...
3
votes
1answer
325 views

Category slug is getting numbers appended to it

I have a category Australia and have been experimenting with boboldehampsink import plugin. After deleting categories and starting over the category Australia now has a slug called 'australia-6'. I ...
3
votes
1answer
1k views

How do I create an advanced route with multiple slugs?

I'm trying to create a route for an RSS feed which allows for the following routes. domain/feed domain/category/feed domain/category/subcategory/feed I have the first two routes working and the ...
5
votes
1answer
555 views

How to add year and month to Entry URL Format

I'd like to make the Entry URL format of a channel look like this: /news/2015/06/my-slug-here What would I need to enter into the Entry URL Format field in order to do this? The closest I could ...
1
vote
1answer
228 views

How to create an auxiliary page with sub url?

I have a section where each item has its own URL e.g: news/{slug} The Entry Template for this section is: news/news_detail For each post I would like to have a link to a unique page which is ...
3
votes
3answers
266 views

Trouble with transliteration in slug caused by hardcoded charmap in craft.js

I've been struggling with automatic slug generation in Czech language: there are letters such as "š" or "č" and Craft has a charactere map hardcoded in craft/app/resources/js/craft.js, resp. craft/app/...
1
vote
1answer
569 views

How to Generate Unique Slugs for a Section without ticking “Entries in this section have their own URLs”

I am working on a site that has an events calendar with Future, Current and Expired events being shown. Which is completely fine when I am on the index page and have "Entries in this section have ...
1
vote
1answer
515 views

Querying database for slug match?

Does anyone know how to query the database to find entry data based on a slug? The only table field I see that contains slug data is in craft_entryversions.data in json format. Anyone ever tried ...
1
vote
1answer
660 views

customised slugs using custom field

I have a 'Profile' channel that gives the profile of people. I have 'Last name' as the title, 'first name' and I'd like to use first name in the slug rather than have to add the first name to the ...
3
votes
1answer
428 views

Auto generation of localised slug

When an entry is created and saved in a locale the corresponding entry is created for other locales using the original title. However, when the title of the locale which needs translating is edited ...
3
votes
2answers
355 views

Can I use translated properties for URL formats

Here's my scenario. I have a structure section: "events". Within that I have three entry types: "events", "exhibitions", "specials". I would like the events to follow the following URL structure: {...
3
votes
2answers
2k views

Get content of single by slug

I'm trying to get the content of a single using a slug from the url. I'm using the following code: {% set item = craft.entries.slug(craft.request.getSegment(1)).first() %} This doesn't work, returns ...
1
vote
1answer
1k views

Get a page URL using only the Slug?

Wondered what the best approach would be to get the url for a given entry page using only a slug for reference? I imagined it being something like this: public function getPageURL($slug) { $page ...
1
vote
1answer
3k views

How to filter entries by slug in url segment?

I want to return entries in the news section, except the one that has a slug the matches url segment 2. I've tried: {% for entry in craft.entries.section('news').slug(not craft.request.getSegment(2))...