We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Auto-increment form title_url

How Do I?

Halogen's avatar
Halogen
74 posts
8 years ago
Halogen's avatar Halogen

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!!!

       
JT Thompson's avatar
JT Thompson
745 posts
8 years ago
JT Thompson's avatar JT Thompson

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.