Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Dynamic Variables to be appended to URL titles, to ensure URL Titles are unique. #2645

Closed
1 task
andy-moogaloo opened this issue Dec 15, 2022 · 5 comments · Fixed by #3046
Closed
1 task

Comments

@andy-moogaloo
Copy link

andy-moogaloo commented Dec 15, 2022

Is your feature request related to a problem? Please describe.
When creating a new entry, if the Title, and therefore URL title already exists, it asks the user to amend the URL title to make it unique, something we shouldn't be expecting non-techy clients (who don't understand "websafe") to be doing.
For some projects this is annoying, eg where multiple events with the same title (eg "Aberdeen Meet-Up") exists on a weekly basis. The {exp:channel:forms} allows us to dynamically generate a URL title using othe values, eg dynamic_title="{title}-{custom_field}-{current_time}" - it would be really helpful if the CP would allow us to do this too.

Describe the solution you'd like
Allow, within the channel settings, the option to use variables such as {entry_id}, {current_time}, or any {custom_field} to be added to the start / end of the URL title, as a way to ensure URL Titles are always unique, without requiring clients to go amending these.

Describe alternatives you've considered
A checkbox that appends a random string to the URL title, perhaps if it already exists, or othewise by default.

Teachability, Documentation, Adoption, Migration Strategy
In the directions for Edit Channel > Settings > Defaults, add an additional field for URL title suffix, with directions to cover:
URL title suffix assigned to all new entries in this channel. Dynamic variables {current_time} or {entry_id} are also available, eg -{current_time format="%d-%Y"}

  • I am capable and would like to work on implementation of this feature if it is considered.
    I can't write PHP I'm afraid, but more than happy to test it.
@pyrobob83
Copy link

+1 for this, but also make sure that any settings transpose over to the Structure URLs too, so listings in structure can benefit from those same unique slugs.

@shbchk
Copy link

shbchk commented Dec 16, 2022

+1

1 similar comment
@lincolnpixel
Copy link

+1

@intoeetive
Copy link
Contributor

intoeetive commented Dec 29, 2022

The referenced PR #2677 should solve the problem for people who don't care much about the exact syntax of URL title.

It does not do exactly what is being requested here, as it only presents a toggle to enforce unique URL titles, without possibility to choose the format, so keeping this issue open for now - but we believe this will cover what most people need.

@andy-moogaloo
Copy link
Author

Not personally fussed by the exact syntax of the URL Title, just needs to be forced to be unique by the CP.
Can this be added to ExpressionEngine v6 too?

matthewjohns0n added a commit that referenced this issue Feb 27, 2023
…to-url-titles

Added per-channel setting to enforce automatic URL titles for entries; #952; #2645; #183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants