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.

EE tags producing new HTML elements

September 16, 2012 2:42am

Subscribe [1]
  • #1 / Sep 16, 2012 2:42am

    readmetwice

    18 posts

    I seem to get varied rendered HTML in my webpage, specifically extra “” elements using what seem as similar EE tags. For the EE template code below:

    {exp:query sql="SELECT…}
    <h3><a title="View details" href="{path='group/index/{url}'}">{title}</a></h3>
    {/exp:query}

    The html correctly renders:

    <h3>
    <a href="http://mysite.com/index.php/S/group/entry_url" title="View details">Entry Title</a>
    </h3>

    But for similar EE template code:

    {exp:channel:entries}
    Phone:+44 {phone1}
    {/exp:channel:entries}

    Renders the “phone1” tag as a new “” element as so:

    Phone:+44 
    21340171


    Giving me the tag content in an unwanted new line, I just want on one line “Phone:+44 21340171”. The containing div has a large enough width to hold the contents of “phone1”

  • #2 / Sep 18, 2012 12:07pm

    Lisa Wess

    20502 posts

    Hi, readmetwice -

    Have you double checked that the {phone1} custom field is set to formatting: none?  Otherwise it will, in fact, try to add HTML formatting as you see there.

    Let me know if that helps!

  • #3 / Sep 18, 2012 6:24pm

    readmetwice

    18 posts

    There is no formatting.

  • #4 / Sep 18, 2012 7:26pm

    Lisa Wess

    20502 posts

    Hi, readmetwice -

    Could you post a screenshot of {phone1}‘s custom field’s settings please?

    You may need to set it to xHTML, save, then back to None - and hit the checkbox for previous entries, to get this going.

  • #5 / Sep 19, 2012 7:27am

    readmetwice

    18 posts

    Attached. also tried what you mentioned

  • #6 / Sep 20, 2012 5:51pm

    Kevin Smith

    4784 posts

    Hi readmetwice,

    It does indeed sound like the formatting for some or all of your existing entries may be stuck on XHTML from previous settings. To clear this, let’s do this:

    1) Change the field formatting to XHTML and check the box that reads Update all existing channel entries with your new formatting choice?. Save the field settings.

    2) Go back to edit the field again, and this time repeat the process above but choose “None” as the formatting option. Make sure to check the box that reads Update all existing channel entries with your new formatting choice?. Save the field settings again.

    Does that clear it up?

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

ExpressionEngine News!

#eecms, #events, #releases