ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Need a secondary {title} --> {url_title} custom field -- Does it exist?

August 25, 2012 6:38pm

Subscribe [2]
  • #1 / Aug 25, 2012 6:38pm

    Brainwrek

    75 posts

    I’m building a new SAEF and I need a set of custom fields that acts like the default {title} and {url_title} fields.  When something is entered into {custom_field_1} a url-safe version is auto-copied to {custom_field_2}.

    Wondering if there’s already a plugin/add-on for this out there?  I’ve spent quite a bit of time scrolling through the fieldtypes on Devot:ee, but haven’t found anything yet.

  • #2 / Aug 26, 2012 8:28am

    John Fuller

    779 posts

    I haven’t had to do something like this for quite some time, so I’m working off fuzzy memory. There is a lot that EE can handle automatically in regards to titles in the SAEF. Try hard coding a title in the SAEF (hidden field) and then submitting a few entries. I believe EE automatically adds an increment to the title name and then auto creates a URL friendly url_title based on that title. If that doesn’t help you, then provide more details.

  • #3 / Aug 26, 2012 2:17pm

    Brainwrek

    75 posts

    Hi John.  Thank you for taking the time.

    Yes, you’ve nailed it.  I will be auto-generating the ‘official’ {title} and {url_title} fields (via hidden form fields) exactly as you mentioned.  But I want the user to have an option to add his/her own “Pseudo” Title (ie a secondary title)—which should then auto generate a “Pseudo” URL_Title.  My reasoning for doing so is a bit complicated, so I’ll save you the details. 

    BUT… for anyone else who needs to do something like this, here are a couple of links that describe crafting a similar setup using Javascript.

    http://stackoverflow.com/questions/3823784/jquery-set-text-to-lowercase-and-replace-space-with-hyphens-on-keyup
    http://www.mediacollege.com/internet/javascript/text/case-lowercase.html

  • #4 / Aug 26, 2012 4:12pm

    John Fuller

    779 posts

    Maybe create a custom member field for this, wrap the SAEF inside the custom profile data tag and then output that field to the SAEF title? I have never done that but it think it should work.

    http://ellislab.com/expressionengine/user-guide/modules/member/index.html#custom-profile-data-tag

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases