Good evening.
I’m curious if anyone is aware of a way to auto-increment the field “url_title”? I use the form to let my customers submit data, but they don’t always know that the title (and thus, the auto-generated “url_title”) must be unique.
Was hopping for a way to auto-generate a title url of “item-2” if there is already an “item”. Someone suggested using an {entry_id} field, but I can’t quite figure out how to get that to work for the “url_title” field.
Running ExpressionEngine 3.5.1
Thanks so much!!!
Not allot of info given here - but I’ll take a stab at it by assuming your form is a frontend one. If that is indeed the case the appropriate thing to do here would be use Javascript to modify the title field on the form to something unique - you would perform a lookup of the proposed url title (based on the rules you set in ee - i.e. the same title->url_title that EE performs). You could then either notify the user that their title is not unique (and handle it like an error condition - not allow the form to be submitted) - or use some sort of predetermined scheme (like you mentioned) to modify the title.
To be honest that’s allot of work for something that can be done much easier…why not just inform the user what their title is after they submit the form? You could give them the option of changing it to something unique - or they can accept it as modified. It wouldn’t hurt to put some info on the form too. 😉.
Another way to handle it is just show the user what the title of their entry is after they submit it and give them the option to change it.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.