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.

Validation Error

May 31, 2010 10:21am

Subscribe [3]
  • #1 / May 31, 2010 10:21am

    Greg8033

    58 posts

    I’m getting an validation error on this page.

    http://517design.com/NewCreations.php?/webDesign/

    http://validator.w3.org/

  • #2 / May 31, 2010 10:31am

    Sue Crocker

    26054 posts

    Greg8033, this has nothing to do with EE. It has to do with you using id=“webDesign” twice on the page.

  • #3 / May 31, 2010 10:50am

    Greg8033

    58 posts

    Ok let me ask this….

    I am currently using this for my menu bar;

    <body {if embed:body_id} id="{embed:body_id}" 
    {if:elseif segment_1} id="{segment_1}" 
    {if:else} id="home" {/if} class="screen">

    to work with my body id. This is why id=“webDesign” is appearing twice on the page.

    How can I get the same results with out id=“webDesign” appearing twice on the page? Thanks

  • #4 / May 31, 2010 3:46pm

    Ingmar

    29245 posts

    If you are using advanced conditionals you must not use the deprecated short form of {if foo}. Try this:

    <body {if embed:body_id != ""} id="{embed:body_id}" 
    {if:elseif segment_1 != ""} id="{segment_1}" 
    {if:else} id="home" {/if} class="screen">
  • #5 / May 31, 2010 4:53pm

    Greg8033

    58 posts

    I replaced my original code

    <body {if embed:body_id} id="{embed:body_id}" {if:elseif segment_1} id="{segment_1}" {if:else} id="home" {/if} class="screen">

    with the code in the last reply

    <body {if embed:body_id != ""} id="{embed:body_id}" {if:elseif segment_1 != ""} id="{segment_1}" {if:else} id="home" {/if} class="screen">

    But the id=“webDesign” is still coming up twice.

  • #6 / May 31, 2010 5:00pm

    Ingmar

    29245 posts

    You’ll need to do some reduction testing, I am afraid. Try to reduce your conditional to keep it as simple as possible. Perhaps start with simple ones:

    {if embed:body_id != ""}{embed:body_id}{/if}
    {if embed:body_id == "" && segment_1 != ""}{segment_1}{/if}

    Take it from there. It’s in all probability an issue with your conditional.

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

ExpressionEngine News!

#eecms, #events, #releases