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.

URL Encode a title on the template side

May 05, 2011 8:12am

Subscribe [2]
  • #1 / May 05, 2011 8:12am

    Neil Evans

    1403 posts

    When you add a title in the channel entry section - the URL-title is auto created for you…

    I am running a multilingual site and intend to have titles for each language.
    On the template side of things i will then be adding this title to the end of the url for keywording purposes.

    However, of course this is going to have lots of funny characters, spaces, etc in it.
    Now i am 99% positive there is either an EE template tag, or a CI helper that would do this conversion without me having to manually do it… But for the life of me i cannot find it.
    Does anyone know this off the top of their head?

    I do not mind if it is either an EE tag or in CI and i will make a little plugin - anything!
    Thanks hope you can help me find it - i’ll keep looking in the mean time!

  • #2 / May 06, 2011 5:47am

    John Henry Donovan

    12339 posts

    nevsie,

    Characters in the URL title field are automatically converted.

    For example try copying and pasting ‘für’ into the title field and you will see the URL title field update with ‘fuer’

    Is this not the case for you?

  • #3 / May 06, 2011 6:21am

    Neil Evans

    1403 posts

    Hi John,
    Think i did not explain very well…

    Yes from the backend the title field is auto-url-encoded… however, if i am have title, title_fr, title_de - these other titles would not be converted as the system only see’s them as one entry, with one URL-title to make.

    From the template side i am using - domain.com/group/template/id/keyword-string
    Where keyword string would be relevant to the language to aid in local searches, etc.

    Therefore, for english - i can easily use “url_title” but i do not have an option for this for title_fr, title_de, etc.
    Hence i was either after a template tag, or plugin, or the CI helper so i could make a plugin.

    It took me a while digging (i was looking for encode first!) but i found the CI helper:
    url_title() at http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html
    And when i was about to build the plugin i found @_rsan had already produced the plugin:
    http://devot-ee.com/add-ons/create-url-title/

    So… multi lingual site keeps moving forward! just very slowly.

  • #4 / May 06, 2011 6:23am

    John Henry Donovan

    12339 posts

    Ah ok I get you now 😊
    And awesome find on the plugin. Bookmaking for myself. I there anything else we can help you with regarding this?

  • #5 / May 06, 2011 6:27am

    Neil Evans

    1403 posts

    nope, thats great thanks, close away!

  • #6 / May 06, 2011 6:31am

    John Henry Donovan

    12339 posts

    Good stuff. Feel free as always to start a new thread if you have any more questions

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

ExpressionEngine News!

#eecms, #events, #releases