Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    help question Sorting out HTML Validation

    I know that I should be hung from my toe nails and beaten with an organic carrot for not using an HTML validator from the 1st of using Zen-Cart.

    But this is now water under the bridge and now that I started using the W3C HTML validator I am struggling with some error (?) messages. For example, in my template's english.php I defined:
    PHP Code:
    define('BOX_INFORMATION_SHIPPING''Shipping & Returns'); 
    Yet, the validator claims that this string, despite me using the proper escape code for the ampersand symbol, is erroneous:

    # Warning Line 170, Column 134: character "&" is the first character of a delimiter but occurred as data

    …6309fd86830a70c4f9638462b">Shipping & Returns</a>

    This message may appear in several cases:

    * You tried to include the "<" character in your page: you should escape it as "&lt;"
    * You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
    * Another possibility is that you forgot to close quotes in a previous tag.
    What is going on here? Is this really a problem? If not, how do I turn it off so that I can tell the forest from the trees? I am currently troubleshooting a problem in my page and with scores of "false positives" like this it is almost impossible for me to find the source of the problem.

    Thanks!

  2. #2
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,247
    Plugin Contributions
    58

    Default Re: HTML Validation & Zen-Cart

    Post the link, the ampersand may be only a result of the issue... The validator can be tricky.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  3. #3
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    Default Re: HTML Validation & Zen-Cart

    Quote Originally Posted by mprough View Post
    Post the link, the ampersand may be only a result of the issue... The validator can be tricky.
    Thank you, Melanie.

    Here is the link to the simplified test site, which exhibits the same problem as the main site (The 'Go' link for the site search function simply doesn't respond to mouse clicks).

    In the test site, I disabled all sideboxes and center boxes in order to reduce the amount of HTML code I have to go through when making sure that every <div> is properly closed, etc.

    Your help is very much appreciated.

    Thanks,
    Daniel

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: HTML Validation & Zen-Cart

    Both sites use this code:

    <li id="categories_tabs_main">
    <div id="Downloadables">
    <a href="index.php?main_page=index&cPath=2"><img src="includes/templates/candy/images/downloadables.gif"

    Presuming you manually inserted the link, change the & to the ASCII value for all 3 links.


    The main site has more Validation errors as you have incorrect HMTL in some places and mis-matched DIV tags in others.

  5. #5
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    Default Re: HTML Validation & Zen-Cart

    Thank you, Rob.
    Quote Originally Posted by Website Rob View Post
    Presuming you manually inserted the link, change the & to the ASCII value for all 3 links.
    You are correct in that the link was inserted manually but in the test site, I actually replaced the & with &amp; and the validator still issues the same warning.

    Is it possible that I need to wrap the &amp; with another layer, such as htmlspecialchars() as described in this thread?

    Quote Originally Posted by Website Rob View Post
    The main site has more Validation errors as you have incorrect HTML in some places and mis-matched DIV tags in others.
    Is there a tool that can quickly display mismatched DIV tags? Finding those visually is daunting...

    Thanks!

  6. #6
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: HTML Validation & Zen-Cart

    http://validator.w3.org/ << will show you your errors

    You have some ambiguity here:

    </div>
    -->
    <ul id="categories_tabs">

    With a closing Comment tag but no opening tag, your links with the ampersand are not the ones showing on your page.

  7. #7
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,247
    Plugin Contributions
    58

    Default Re: HTML Validation & Zen-Cart

    This one has 8

    http://validator.w3.org/check?uri=ht...Inline&group=0

    The first is the unescaped ampersand in the link
    <a href="index.php?main_page=index&cPath=2">
    The second is caused by the first

    seeing the trend here?

    the shipping & returns link is the one in the footer... probably and EZ page text. Open the EZ page and add the &amp; then save. Note that next time you will need to re-add it as ZC will forget it.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

 

 

Similar Threads

  1. HTML Validation almost perfect
    By zcnb in forum General Questions
    Replies: 1
    Last Post: 7 May 2009, 02:48 PM
  2. W3C HTML validation help
    By Doodlebuckets in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2008, 08:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg