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.

Links not displaying

April 01, 2010 3:35am

Subscribe [4]
  • #1 / Apr 01, 2010 3:35am

    jhummel

    21 posts

    I have a very strange problem. I can’t put any a tags in my content. If I write some content that contains an a tag, the entry will save fine, and if I edit the entry, the tag is still visible. But when viewing the entry it gets jumbled up and displays something similar to:

    <a >

    and then any content after the link is not displayed. Again, the strange thing is the code is saved correctly in the db. I’m on 1.6.8

    Thanks in advance for any help

  • #2 / Apr 01, 2010 3:40am

    jhummel

    21 posts

    I should point out, that when I say any content after the link is not displayed, I don’t mean it’s just a browser rendering issue. I mean EE is not rendering any HTML after that point.

  • #3 / Apr 01, 2010 3:56am

    jhummel

    21 posts

    Ok. A little more info. If I manually enter the anchor tag with the href value in single quotes instead of double quotes. It will then render the content fine, however, the value will still be saved into the db with a double quote, if I edit that entry, I will see all the a tags will have reverted back to their double quotes, saving that entry again will cause the problem to spring back up. It’s very odd.

  • #4 / Apr 01, 2010 4:31am

    Sue Crocker

    26054 posts

    Are you using any sort of wysiwyg editor with EE? What about extensions in general?

  • #5 / Apr 01, 2010 4:35am

    jhummel

    21 posts

    I’ve tried both with a wysiwyg and without. At first it was a plain textarea, but I thought maybe I was entering links incorrectly, so I got Brandon Kelly’s wygwam, and got the same results. Other extensions are:

    jQuery for the Control Panel (v.1.1.1)
    FieldFrame (v.1.4)
    Gypsy (v.1.0.6)
    LG Addon Updater (v.1.0.2)

  • #6 / Apr 01, 2010 11:27am

    Sue Crocker

    26054 posts

    If you put

    [url=http://expressionengine.com]ExpressionEngine.com[/url]

    inside the entry, what happens? If you put in http://expressionengine.com by itself, what about then?

    There is a per-weblog setting for automatically turning text into links.

  • #7 / Apr 01, 2010 12:27pm

    jhummel

    21 posts

    Putting in:

    [url=http://expressionengine.com]ExpressionEngine.com[/url]

    exhibits the same behavior. The output is fine up until the link, then I see:

    <a href=

    and nothing after that point. I have the preference for automatically turning text into links shut off.

    After more investigation, I realized the problem pops up for more than just anchors, it’s any tag that includes an attribute with a double-quoted value. So something like <b> works fine, but not <b class=“foo”>

    As soon as the output reaches the first double quote it stops.

  • #8 / Apr 01, 2010 12:31pm

    Sue Crocker

    26054 posts

    Are you on the most recent build? 1.6.8 build 20100121?

  • #9 / Apr 01, 2010 12:34pm

    jhummel

    21 posts

    Yep. 20100121

  • #10 / Apr 01, 2010 3:38pm

    jhummel

    21 posts

    Again a little more info…

    To narrow down where the problem was happening, I inserted some text content directly into the db and included some double quotes within a tag. The db accepted the query fine and updated. The frontend, however, displayed the same behavior.

    It must be something when rendering the contents of the tag. Is there any addslashes type stuff happening that could account for it?

  • #11 / Apr 01, 2010 5:03pm

    Ingmar

    29245 posts

    Can you show us a link to where this is happening? Would be helpful to see this for ourselves.

  • #12 / Apr 02, 2010 12:18am

    jhummel

    21 posts

    http://www.pedigreetchnologies.com.humjay.com/contact/

    You’ll see there’s supposed to be a mailto link immediately following the text:
    “To learn more about Pedigree Technologies and our product offerings, contact:”

    I’m stumped. Hope you can see something. Thanks!

  • #13 / Apr 02, 2010 2:40am

    jhummel

    21 posts

    Ok. I think I see what’s happening. I’m passing the value to a sub-template through an embed variable. In my main template I have:

    {embed="includes/content" main_content="{body}”}

    I think the quotes within tags are screwing up the templating when EE is coming around to processes the outer template. Any suggestions for passing HTML through an embed variable?

  • #14 / Apr 02, 2010 3:15am

    jhummel

    21 posts

    Ok. I got it. For future reference, if anyone is trying to pass html through embed variables, there’s a couple of extra steps you need to take. EE parses the variable values first, so something like

    {embed foo="{my_html_value}"

    is going to fail if you have quotes in the html tags. Regular quotes within your text are ok, as EE will replace them with HTML entities, but it skips the ones inside of tags like for <div class=“foo”>

    The way I solved it was through a plugin. I used low replace to do my searching. You can’t simply search for a double quote however within the plugin tags because of the same issue as above:

    {exp:replace find="""}

    EE is going to see that as finding a value for nothing instead of a double quote. Luckily the author of the plugin had the foresight to provide a workaround by using the constant QUOTE. Using this, we can replace our quotes with a token before sending it through to the sub template:

    {embed="includes/content"
            main_content        = "{exp:replace find="QUOTE" replace="__DQ__"}{body}{/exp:replace}"
    }

    in the subtemplate, we reverse the procedure to get our original quotes back:

    {exp:replace find="__DQ__" replace="QUOTE"}{embed:main_content}{/exp:replace}

    Kind of clunky, but it seems to work.

  • #15 / Apr 02, 2010 3:25am

    John Henry Donovan

    12339 posts

    Glad you are up and running again and thanks for providing your solution. Feel free 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