Default Slug Format #16664
Unanswered
MoritzLost
asked this question in
Ideas
Default Slug Format
#16664
Replies: 1 comment 1 reply
-
Another option you could do is create a “Custom URI” field, which overrides the default podcasts/{{ customUri ?? "#{episode}-#{slug}" }} Or, a “Include episode number in URI” Lightswitch field, which is enabled by default: podcasts/{{ includeEpInUri ? "#{episode}-" }}{{ slug }} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be great to have an option to define the default slug format for entries, similar to the default title format.
A common scenario is that you want URLs to have a specific structure, but still allow users to change the URL for some entries. But this is difficult because the slug is always generated based on the title.
For example, I have a channel for Podcast episodes. The podcast entry type has an
episode
number field and atitle
. For most entries, I want a URL structure like this:podcasts/{episode}-{title}
, e.g.podcasts/123-foobar
. But for some specific podcast episodes, the authors want to be able to usepodcasts/my-special-seo-optimized-url
.I have two options here:
{episode}
in the URL, which will not allow authors to create URLs without the episode number.podcasts/{slug}
as URL format for maximum flexibility. However, thetitle
is just the topic without the episode number, so then you have to remember to always manually add the episode number to the slug, or you will end up with URLs likepodcasts/foobar
without the episode number by default.There are various ways to move the problem around, but the issue remains that you're entering the episode number at least twice.
I think the best way to solve this would be to add a Default Slug Format setting to entry types, similar to the Default Title Format. That would allow me to specify the default slug format based on other fields than the title, but still allow maximum flexibility for authors to use different slugs.
Beta Was this translation helpful? Give feedback.
All reactions