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.

Entities in title field being encoded when I don't want them to be.

January 28, 2009 12:19pm

Subscribe [2]
  • #1 / Jan 28, 2009 12:19pm

    camwest

    14 posts

    Hey There:


    Image 1

    I have the following title.  And it’s getting output like this:

    Image 2

    How can I make it output like a straight ampersand?

    I’m already wrapping my elements in CDATA tags so there is no need for the conversion.

  • #2 / Jan 28, 2009 12:49pm

    Pascal Kriete

    2589 posts

    camwest,

    We have to use an entity for the ampersand or we would not be sending well formed xml.  The ampersand is a predefined entity and has to be escaped.

    That said, it is up to the feed reader to recognize it and and then parse it correctly.  A lot of them are capable of that, unfortunately Firefox apparently does not fall among them.  An alternative might be to replace it with a regular ‘and’ using one of the find-and-replace plugins.

    Does that help?

  • #3 / Jan 28, 2009 12:51pm

    camwest

    14 posts

    Pascal,

    That’s not correct actually. It would be well formed XML if the node was enclosed in CDATA tags <![CDATA[ & ]]> is completely valid.  That said.  The category title’s output without converting to entities, so why would the web log titles? Also, custom fields don’t do this…

  • #4 / Jan 28, 2009 1:31pm

    camwest

    14 posts

    Here is an example well-formed XML file with ampersands right in the elements node value. 

    http://fashioncrimes.bigbangtechnology.com/feeds/content

    This works fine and dandy except for in section title fields where it is converting my

    & to &
    
    
    See -> Prom & Grad
  • #5 / Jan 28, 2009 3:57pm

    Ingmar

    29245 posts

    Unfortunately that’s just how things stand at the moment: EE applies the light_typography class to the title field, and ampersands get converted into entities. As a workaround, a find and replace might work. That said, please do feel free to make a feature request to have this behavior change in future versions.

  • #6 / Jan 28, 2009 5:09pm

    camwest

    14 posts

    Ok thanks Ingmar/Pascal.

  • #7 / Jan 28, 2009 5:11pm

    Ingmar

    29245 posts

    Marking as resolved. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases