Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Annoying Home Page Validation (Just one Error)

    I can't seem to figure out what's causing this error on the home page of www.silkblooms.co.uk:

    "line 443 column 3 - Error: document type does not allow element "ul" here; assuming missing "li" start-tag"

    Can anyone see what's causing it? It's quite annoying to have just one validation error on the home page. Would love to have none :)

  2. #2
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,296
    Plugin Contributions
    1

    Default Re: Annoying Home Page Validation (Just one Error)

    It looks to me as though you need a <li> just before the <ul> in line 443. There's a closing </li> in line 473 without an opening tag

    I've just tried it and it seems to work.

  3. #3
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Annoying Home Page Validation (Just one Error)

    Quote Originally Posted by simon1066 View Post
    It looks to me as though you need a <li> just before the <ul> in line 443. There's a closing </li> in line 473 without an opening tag

    I've just tried it and it seems to work.
    Thanks for the reply. New question. Which file is generating line 473? I tried to track it down and it was leading me to /includes/functions/extra_functions/categories_dressing_functions.php as this is one of the few files with a <ul>

    Adding a <li> just before it didn't cure the problem, it created another (2 validation errors)........ sop probably not the correct file?

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,296
    Plugin Contributions
    1

    Default Re: Annoying Home Page Validation (Just one Error)

    All I did to cure the error was to input the <li> into the source at validator.w3.org - it then validated ok, I've had similar problems like this in the past and as li/ul's can be from different files it can be pretty difficult to track down the correct location for such missing tags. I can only suggest to perhaps find the file that has the closing </li> (on line #473 in the 'show source' section of the validator) and see if that file is an appropriate place to add the missing tag to.

    Sorry can't be of more help here.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Annoying Home Page Validation (Just one Error)

    Actually, you need a closing </ul> before the <ul> that's on line 443.
    Code:
    <!--// bof: chcategories //-->
    <div class="leftBoxContainer" id="chcategories" style="width: 190px">
    <h3 class="leftBoxHeading" id="chcategoriesHeading">Wedding Flowers</h3>
    <div id="chcategoriesContent" class="sideBoxContent">
    <ul class="catLinks"><li><a class="category-links" href="http://www.silkblooms.co.uk/index.php?main_page=products_new">New Products ...</a></li>
    </ul><ul>
    <li><div class="catBoxHeading3"> <a href="index.php?main_page=coming_soon">Coming Soon ...</a></div></li>
    <li class="cat-top"><a class="cat-not-selected-text" href="http://www.silkblooms.co.uk/index.php?main_page=index&amp;cPath=349">Hire Products ...</a></li>
    <li><hr class="catBoxDivider1" /></li>
    <li class="cat-bolder"><a class="cat-not-selected-text" href="http://www.silkblooms.co.uk/index.php?main_page=index&amp;cPath=1">All Products ...</a></li>
    <ul>
    <li class="cat-products"><a class="cat-not-selected-text" href="http://www.silkblooms.co.uk/index.php?main_page=index&amp;cPath=1_6">Bridal Bouquets</a></li>
    And that code appears to be generated from within the "chcategories" addon you're using.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Annoying Home Page Validation (Just one Error)

    Something's telling me it's in this file, but I can't seem to fix it. Everything I try seems to make it worse. Can you see anything in this file that can be causing it?

    PHP Code:
    <?php
    /**
     * @copyright Copyright 2009 Glenn Herbert
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.gnu.org/licenses/ GNU Public License V3.0
     * includes/functions/extra_functions/categories_dressing_functions.php
     * Categories Dressing v2.6  - Glenn Herbert (gjh42)   - 20090128 
     */

    function cat_active_level_manage($path) {
      
    $skip_cat 0;
      if (
    defined('CAT_BOX_ACTIVE_LEVEL')) {
        
    $cat_box_active_level explode('|',constant('CAT_BOX_ACTIVE_LEVEL'));
        
    $current_top = (int)$_GET['cPath'];
        
    $iteration_top = (int)$path// set = this iteration's topcat
        
    $cat_depth substr_count($path,'_');
        
    //tests for various kinds of skipping - more can be added
        
    $skip_cat $skip_cat + ($cat_box_active_level[0] == and $current_top != $iteration_top)?1:0;
        
    $skip_cat $skip_cat + ($cat_box_active_level[0] == and $current_top != $iteration_top and $current_top != 0)?1:0;
        
    $skip_cat $skip_cat + ($cat_box_active_level[1] > $cat_depth and $cat_box_active_level[0] != 2)?1:0;
        
    $skip_cat $skip_cat + ($cat_box_active_level[2] < $cat_depth)?1:0;
      }
    //defined
      
    return $skip_cat;
    }


    function 
    cat_ul_manage($current_path, &$prev_cat_depth$new_group) {
      
    $ul_content '';
      
    $cat_depth substr_count($current_path,'_');
      if (
    $cat_depth $prev_cat_depth) {
        
    $ul_content .= str_repeat('<ul>',(($cat_depth $prev_cat_depth) - $new_group)) . "\n";
      } elseif (
    $cat_depth $prev_cat_depth) {
        
    $ul_content .= str_repeat('</ul>',(($prev_cat_depth $cat_depth) + $new_group)) . "\n";
      } else {
        
    $ul_content .= $new_group?'</ul>':'';
      }
      
    $ul_content .= $new_group?'<ul id="catGroup' $current_path '">' "\n":'';
      
    $prev_cat_depth $cat_depth;
      return 
    $ul_content;
    }

    function 
    cat_box_heading($current_path) {
      
    $heading_content '';
      
    $new_group 0;
      if (
    defined('CAT_BOX_HEADING_' $current_path)) {
        
    $cat_box_heading explode('|',constant('CAT_BOX_HEADING_' $current_path));
        if (
    $cat_box_heading[0]) {
          
    $new_group 1;
        }
        if (
    $cat_box_heading[1]) {
          
    $heading_content .= '<hr class="catBoxDivider' $cat_box_heading[1] . '" />' "\n"
        }
        if (
    $cat_box_heading[2]) {
          
    //display image if exists for category name in current language - with title tag
          
    $heading_content .= file_exists(DIR_WS_TEMPLATE 'buttons/' $_SESSION['language'] . '/' $cat_box_heading[2]) ? '<div class="catBoxHeadingImg">' zen_image(DIR_WS_TEMPLATE 'buttons/' $_SESSION['language'] . '/' $cat_box_heading[2], $cat_box_heading[3]) . '</div>' "\n":$cat_box_heading[3] . "\n";
        }
        
    $i=4;
        while (
    $i<(sizeof($cat_box_heading)-1)) {
          
    $heading_content .= '<div class="catBoxHeading' $cat_box_heading[$i+1] . '">' .  $cat_box_heading[$i] . '</div>' "\n";
          
    $i $i+2;
        }
      }
      return array(
    $new_group,$heading_content);
    }
        
    function 
    cat_name_display($cat_name_display$current_path) {
      
    $cat_img_bg '';
      
    //display image if exists for category name in current language - with title tag
      
    if (file_exists(DIR_WS_TEMPLATE 'buttons/' $_SESSION['language'] . '/catimg' $current_path '.gif')) {
        
    $cat_name_display zen_image(DIR_WS_TEMPLATE 'buttons/' $_SESSION['language'] . '/catimg' $current_path '.gif''''''''title="' $cat_name_display '"'); 
      
    //display background image if exists for category name in current language - with title tag
      
    } elseif (file_exists(DIR_WS_TEMPLATE 'buttons/' $_SESSION['language'] . '/catbg' $current_path '.gif')) {
        
    $cat_name_display zen_image(DIR_WS_TEMPLATE_IMAGES 'pixel_trans.gif''''100%''100%''title="' $cat_name_display '"');
        
    $cat_img_bg ' catBg' $current_path;
      } else {
        
    $cat_img_bg '-text';//append to main classname
      
    }
      return array(
    $cat_img_bg$cat_name_display);
    }

    function 
    cat_box_subtext($current_path) {
      
    $subtext '';
      if (
    defined('CAT_BOX_SUBTEXT_' $current_path)) {
        
    $cat_box_subtext explode('|',constant('CAT_BOX_SUBTEXT_' $current_path));
        
    $subtext .= '<div class="catBoxSubtext' $cat_box_subtext[1] . '">' $cat_box_subtext[0] . '</div>' "\n";
      }
      return 
    $subtext;
    }
    ?>

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Annoying Home Page Validation (Just one Error)

    Replace the obsolete v2.6 of Categories Dressing with the latest released v2.7.3 and this error will be eliminated. You don't need to replace the categories_dressing_defines.php; there might be some new stock defines you could add to that file, I don't remember exactly what changed between those versions. You would need to make the correct settings to activate the desired switch case in the new categories_dressing_functions.php. See the readme for more info.

  8. #8
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Annoying Home Page Validation (Just one Error)

    Thanks for replying Glen. I tried to upgade to the latest version some time ago and it was proving a bit tricky for me. Can't remember exactly what it was doing but it was going to take me a while to try and fix it back to how we need it. Is there a simpler way to just inset a closing </ul> in the file to fix the validation error as I'd prefer to just stick with the v.2.6 which works beautifully, otherwise.

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Annoying Home Page Validation (Just one Error)

    Compare these functions... you may be able to just swap the newer one in.
    V2.6:
    PHP Code:
    function cat_ul_manage($current_path, &$prev_cat_depth$new_group) {
      
    $ul_content '';
      
    $cat_depth substr_count($current_path,'_');
      if (
    $cat_depth $prev_cat_depth) {
        
    $ul_content .= str_repeat('<ul>',(($cat_depth $prev_cat_depth) - $new_group)) . "\n";
      } elseif (
    $cat_depth $prev_cat_depth) {
        
    $ul_content .= str_repeat('</ul>',(($prev_cat_depth $cat_depth) + $new_group)) . "\n";
      } else {
        
    $ul_content .= $new_group?'</ul>':'';
      }
      
    $ul_content .= $new_group?'<ul id="catGroup' $current_path '">' "\n":'';
      
    $prev_cat_depth $cat_depth;
      return 
    $ul_content;

    V2.7.3:
    PHP Code:
    function cat_ul_manage($current_path, &$prev_cat_depth$new_group) {
      
    $ul_content '';
      
    $cat_depth substr_count($current_path,'_');
      
    $group_id ' id="catGroup' $current_path '"';
      if (
    $prev_cat_depth 0) {//first item
        
    $ul_content .= str_repeat("\n" '<ul><li>',$cat_depth) . "\n" '<ul' $group_id '>' "\n";
      } else {
        if (
    $cat_depth $prev_cat_depth) {//deeper
          
    $ul_content .= str_repeat('<ul><li>',($cat_depth $prev_cat_depth 1)) . "\n" '<ul' $group_id '>' "\n";
        } elseif (
    $cat_depth $prev_cat_depth) {//higher
           
    $ul_content .= str_repeat('</li>' "\n" '</ul>',($prev_cat_depth $cat_depth)) . ($new_group?'</li>' "\n" '</ul>' . ($cat_depth 0'</li>' "\n" '  <li>':'') . "\n" '<ul' $group_id '>':'</li>') . "\n";
        } else {
    //no depth change
          
    $ul_content .= '</li>' . ($new_group?"\n" '</ul>' . ($cat_depth 0'</li>' "\n" '  <li>':'') . "\n" '<ul' $group_id '>':'') . "\n";
        }
      }
    //if
      
    $prev_cat_depth $cat_depth;
      return 
    $ul_content;


  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Annoying Home Page Validation (Just one Error)

    Your tpl_categories.php should have this line just below the top comments:
    PHP Code:
    $prev_cat_depth = -1;//do not alter 
    If it is not like that, replace the original with this version.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Hide a <div> in JUST the home page..
    By DivaVocals in forum Templates, Stylesheets, Page Layout
    Replies: 29
    Last Post: 30 Sep 2014, 07:42 PM
  2. Links just randomly appeared on home page?
    By Inxie in forum Templates, Stylesheets, Page Layout
    Replies: 16
    Last Post: 8 Sep 2012, 11:31 AM
  3. v138a Home page validation
    By btman in forum General Questions
    Replies: 4
    Last Post: 25 Mar 2012, 01:36 AM
  4. Changing Page Titles. Not just on the Home Page
    By Globie in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Aug 2008, 11:35 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR