Cms: Add slug field to singles entries

Created on 10 Oct 2018  路  5Comments  路  Source: craftcms/cms

Currently only way to set url for single type section is to do this in its settings, using URI field. I propose adding standard slug field to these sections, just like one that exists for structures and channels.

My reasons for this proposal are:

  • Singles still have slug - you can use {slug} variable in URI field. But, without slug field, there is no way to change this initial slug that was created while creating entry (except temporary changing section type to channel or structure maybe).
  • I dont want my content creators to go into settings to just change url of some entry - multitude of options present there would just confuse them and they might break something.
content modeling enhancement

All 5 comments

Just added this for the next 3.2 Alpha release.

@brandonkelly Should there be an option to disable user editable slugs on singles?

For instance, a single may be a landing page for a news section, so we'd set this single to /news. Then, all news posts in our news channel would be news/{slug}.

Also, there may be existing template structures that don't count on users being able to edit slugs on singles. Because of this, I'd recommend that editable slugs on singles is an opt-in feature.

@jsunsawyer We can address that at the same time as #3953 for Craft 4, where it will be possible to customize which CMS-defined fields should be visible, and where.

@brandonkelly Since #3953 already got merged; is the option to disable editing the slug of single entries still planned? we have many cases wehre it shouln't be possible to do so. Thanks!

Sorry yeah the new field layout changes in 3.5 didn鈥檛 go as far as what we鈥檇 planned to do in 4.0 so there鈥檚 still room for improvement here. Will reopen this and add it to the 4.0 milestone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davist11 picture davist11  路  3Comments

angrybrad picture angrybrad  路  3Comments

lukebailey picture lukebailey  路  3Comments

bitboxfw picture bitboxfw  路  3Comments

timkelty picture timkelty  路  3Comments