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.

Curly Brace in Image Tag

April 22, 2011 12:16am

Subscribe [7]
  • #1 / Apr 22, 2011 12:16am

    junglem

    8 posts

    When I validate it returns an error for having a left facing curly brace in my image tag.

    I don’t have a brace in my image tag in my code but it somehow ends up there.

    After being processed by EE there is a } just after the alt tag like so:

    <img src="/pics/about.jpg" alt="About" } />

    The image is being generated from code in a custom field. The field is set to have no formatting.

    Any ideas?

    Thank you.

  • #2 / Apr 22, 2011 12:41am

    Tony Geer

    253 posts

    Post the code that’s in your template so we can see what’s going on. It’s more than likely you simply have an extra } in there.

  • #3 / Apr 22, 2011 1:32am

    junglem

    8 posts

    Thanks, here it is:

    <!DOCTYPE html>
    
    <html lang="en">
    
    <head>
    
    <meta charset="utf-8" />
    
    <title>Annie</title>
     
    {css-link}
    
    </head>
    
    <body id="about">
    
    <!-- FRAME --><div id="frame">
    
    <!-- HEADER --><div id="header">
    
    {sitenav}
    
    <!-- / HEADER --></div>
    
    <!-- WRAPPER --><div id="wrapper">
    
    <!-- LEFT --><div id="left">
    
    {exp:channel:entries channel="website-copy" limit="1" entry_id="2"}
    
    {webcopy-left-img}
    {webcopy-subtitle}
    
    <!-- /LEFT --></div>
    
    <!-- RIGHT --><div id="right">
    
    {website_copy}
    {/exp:channel:entries}
    
    <!-- /RIGHT --></div>
    
    <!-- /WRAPPER --></div>
    
    <!-- /FRAME --></div>
    
    </body>
    
    </html>
  • #4 / Apr 22, 2011 2:03am

    vosSavant

    380 posts

    Is it safe to assume that your image is being created by the {webcopy-left-img} custom field?

    What type of custom field is this? A straight text input, or a file upload field? Double check the value of that field in your control panel to make sure there isn’t anything in it that would create that extra }.

  • #5 / Apr 22, 2011 1:12pm

    Brandon Jones

    5500 posts

    I’d tend to agree; it seems like that brace is coming from somewhere else. Let us know what you find, junglem!

  • #6 / Apr 22, 2011 5:23pm

    junglem

    8 posts

    Yes, vosSavant, the image is being generated by the {webcopy-left-img}, which is a straight input text with no formatting.

    The validator produced the same result across several different entries.

  • #7 / Apr 23, 2011 2:58pm

    junglem

    8 posts

    Any other ideas?

  • #8 / Apr 23, 2011 3:20pm

    vosSavant

    380 posts

    If you’re open to the idea, I can take a look at your template and field to see what is going on; it’s difficult to know without having a look. I’d need CP access—you can PM that if you like.

  • #9 / Apr 23, 2011 3:22pm

    Greg Salt

    3988 posts

    Hi junglem,

    Can you please post the exact contents of the webcopy-left-img custom field from one of the problematic entries?

    Cheers

    Greg

  • #10 / Apr 24, 2011 1:40am

    junglem

    8 posts

    Here are the exact contents of the webcopy-left-img custom field:

    <img src="/pics/about.jpg" alt="Annie"} />

    I’ll set up access and PM you Ryan…

  • #11 / Apr 24, 2011 5:02pm

    Greg Salt

    3988 posts

    Hi junglem,

    Is that what you have posted into the field in the CP (which is what I meant, sorry if I wasn’t clear) or what’s been generated on the front end?

    Cheers

    Greg

  • #12 / Apr 26, 2011 12:14am

    junglem

    8 posts

    Hi,

    In the CP field it’s exactly the same but without the brace before the closing part of the tag.

    I tried removing the style sheets and it still produced a brace in the HTML.

    Thanks!

  • #13 / Apr 26, 2011 5:30am

    John Henry Donovan

    12339 posts

    junglem,

    We don’t encourage the giving out of CP access to other forum users (no offence Ryan).


    Can you create a blank template please and only add the following and nothing else

    {exp:channel:entries channel="website-copy" limit="1" entry_id="2"}
    
    {webcopy-left-img}
    
    {/exp:channel:entries}
  • #14 / Apr 26, 2011 8:13pm

    junglem

    8 posts

    Okay, I won’t allow any CP access. Thanks anyhow, Ryan.

    John, I made a template with the code above and the brace is still in there.

  • #15 / Apr 27, 2011 3:49pm

    Brandon Jones

    5500 posts

    junglem,

    Try creating a new text field, and see if it has the same issue. Are you getting the image URL into the field via the image (tree icon) button? If so, check your IMG button under Default HTML buttons to see if perhaps there’s curly brace in the opening or closing tag fields.

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

ExpressionEngine News!

#eecms, #events, #releases