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.

Using html-tags in entry title

September 02, 2008 5:33am

Subscribe [5]
  • #1 / Sep 02, 2008 5:33am

    vibes

    3 posts

    Dear people,

    I’m having problems with using html-tas in entry titles. We developed a system that uses ‘®’ in the title field. However, the client inputted ‘®’ and later saw they wanted to use superscript. We queried the database and added the superscript to get it done quickly (there are thousands of entries here). Because of this we never noticed this problem:

    Now, whenever you update the entry, the superscript gets stripped.

    Is there a way that we tell EE not to strip html-code with the title field?

    Thanks in advance,
    Vibes

  • #2 / Sep 02, 2008 9:48am

    Sue Crocker

    26054 posts

    There is a way around it, but that would be to set an additional field to use as the title field that had the superscript code in it.

    Not very elegant, I’m afraid.

  • #3 / Sep 02, 2008 3:59pm

    Lisa Wess

    20502 posts

    Hi, vibes - another custom field would certainly work, depending on how complicated you need that HTML to be.

    If you simply need to use symbols like what you posted, then you could use the Find and Replace plugin and use code like this:

    {exp:replace find="@" replace="<sup>@</sup>"}{title}{/exp:replace}

    This would just be put in your template, and the user would enter their title as normal, so no extra training needed there.

    This also came up recently in this thread.

    Does that help?

  • #4 / Sep 05, 2008 6:24am

    vibes

    3 posts

    thanks for the info. A lot of the entries already have the sup code so we’ll need an extra conditional, but that will not be a problem I think.

    Thanks and regards,
    Vibes

  • #5 / Sep 05, 2008 10:16am

    Ingmar

    29245 posts

    Glad to hear it. You’re all good? Or would you want me to move this thread over to Howto?

  • #6 / Sep 05, 2008 10:26am

    Mark Bowen

    12637 posts

    Just as an extra tidbit of information you could probably even use the Find & Replace plugin in regex mode to just change the entries that don’t have the </sup> tags in them instead of using two conditionals.

    I have a working regex code for that here in PHP but couldn’t seem to get it working in the plugin but maybe someone else can :

    Find matches of only the ® character that don’t have the <sup> tags surrounding them

    #(?<!)®(?!)#i

    Don’t know if that helps at all though.

    Best wishes,

    Mark

  • #7 / Sep 05, 2008 3:25pm

    Greg Aker

    6022 posts

    Thanks for the info Mark.  😊

    vibes, are you all squared away?

    Regards,

    -greg

  • #8 / Sep 09, 2008 4:49pm

    vibes

    3 posts

    Thanks every one. We will use an extra field.

    Regards,
    Vibes

    “The important thing is not to stop questioning.”
    Albert Einstein

  • #9 / Sep 09, 2008 4:58pm

    Ingmar

    29245 posts

    That’s probably the best decision,I agree 😊

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

ExpressionEngine News!

#eecms, #events, #releases