Zen Cart Logo
Forums / Addon Templates / Missing <li> Tidy Error

Missing <li> Tidy Error

Locked

Views: 975

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
25 Apr 2010, 5:10 PM
#1
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Missing <li> Tidy Error

zen cart 139a
image handler, fual slimbox, ezpages to sitemap

Having problems fixing this last Tidy error on my site.
When I view the source this is the error?

How can I get rid of this pesty little Tidy error?????

<!-- BOF: CODE TO add EZ-PAGES to Sitemap -->
<li class="SiteMap">Step by Step Guides</li>
<ul class="SiteMap"> <li class="SiteMap"><a href="[includes/templates/hairbun/ezpages/bun/index.html](http://www.zen-cart.com/forum/view-source:http://haredo.com/includes/templates/hairbun/ezpages/bun/index.html)" target="_blank">Bun</a></li>

Here is the first file which I had to winmerge.
your_template/ template/ tpl_site_map_default.php

<?php
/**
 * Page Template
 *
 * Loaded by index.php?main_page=site_map <br />
 * Displays site-map and some hard-coded navigation components
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_site_map_default.php 4340 2006-09-02 04:54:53Z drbyte $
 */
?>
<div class="centerColumn" id="siteMap">

<h1 id="siteMapHeading"><?php echo HEADING_TITLE; ?></h1>

<?php if (DEFINE_SITE_MAP_STATUS >= '1' and DEFINE_SITE_MAP_STATUS <= '2') { ?>
<div id="siteMapMainContent" class="content">
<?php
/**
 * require the html_define for the site_map page
 */
  require($define_page);
?>
</div>
<?php } ?>

    <div id="siteMapList"><?php echo $zen_SiteMapTree->buildTree(); ?>
      <ul>
      	
<!-- BOF: CODE TO add EZ-PAGES to Sitemap -->
	<?php
	$boxes = array('ezpages.php');
	$column_box_default='tpl_box_default_sitemap.php';
	for($ib=0,$nb=sizeof($boxes);$ib<$nb;$ib++) {
		$require_file = "";
		if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $boxes[$ib]) ) {
		 $require_file = DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $boxes[$ib];
		} elseif ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $boxes[$ib]) ) {
		 $require_file = DIR_WS_MODULES . 'sideboxes/' . $boxes[$ib];
		}
		if ($require_file != "") {
			$box_id = zen_get_box_id($boxes[$ib]);
			require($require_file);
		}
	}
	?>
<!-- EOF: CODE TO add EZ-PAGES to Sitemap -->

<?php if (SHOW_ACCOUNT_LINKS_ON_SITE_MAP=='Yes') { ?>
        <li><?php echo '<a href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . PAGE_ACCOUNT . '</a>'; ?>
        <ul>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . PAGE_ACCOUNT_EDIT . '</a>'; ?></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . PAGE_ADDRESS_BOOK . '</a>'; ?></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . PAGE_ACCOUNT_HISTORY . '</a>'; ?></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . PAGE_ACCOUNT_NOTIFICATIONS . '</a>'; ?></li>
        </ul></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_SHOPPING_CART) . '">' . PAGE_SHOPPING_CART . '</a>'; ?></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . PAGE_CHECKOUT_SHIPPING . '</a>'; ?></li>
<?php } //endif ?>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . PAGE_ADVANCED_SEARCH . '</a>'; ?></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . PAGE_PRODUCTS_NEW . '</a>'; ?></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_SPECIALS) . '">' . PAGE_SPECIALS . '</a>'; ?></li>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_REVIEWS) . '">' . PAGE_REVIEWS . '</a>'; ?></li>
          <li><?php echo BOX_HEADING_INFORMATION; ?>
          <ul>
<?php if (DEFINE_SHIPPINGINFO_STATUS <= '1') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>'; ?></li>
<?php } ?>
<?php if (DEFINE_PRIVACY_STATUS <= '1') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>'; ?></li>
<?php } ?>
<?php if (DEFINE_CONDITIONS_STATUS <= '1') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>'; ?></li>
<?php } ?>
<?php if (DEFINE_CONTACT_US_STATUS <= '1') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>'; ?></li>
<?php } ?>
<?php if ( (isset($phpBB->phpBB['db_installed_config']) && $phpBB->phpBB['db_installed_config']) && (isset($phpBB->phpBB['files_installed']) && $phpBB->phpBB['files_installed'])  && (PHPBB_LINKS_ENABLED=='true')) { ?>
            <li><?php echo '<a href="' . zen_href_link($phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX, '', 'NONSSL', false, '', true) . '" target="_blank">' . BOX_BBINDEX . '</a>'; ?></li>
<?php } ?>
<?php if (MODULE_ORDER_TOTAL_GV_STATUS == 'true') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_GV_FAQ) . '">' . BOX_INFORMATION_GV . '</a>'; ?></li>
<?php } ?>
<?php if (MODULE_ORDER_TOTAL_COUPON_STATUS == 'true') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_DISCOUNT_COUPON) . '">' . BOX_INFORMATION_DISCOUNT_COUPONS . '</a>'; ?></li>
<?php } ?>
<?php if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_UNSUBSCRIBE) . '">' . BOX_INFORMATION_UNSUBSCRIBE . '</a>'; ?></li>
<?php } ?>
<?php if (DEFINE_PAGE_2_STATUS <= '1') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_2) . '">' . BOX_INFORMATION_PAGE_2 . '</a>'; ?></li>
<?php } ?>
<?php if (DEFINE_PAGE_3_STATUS <= '1') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_3) . '">' . BOX_INFORMATION_PAGE_3 . '</a>'; ?></li>
<?php } ?>
<?php if (DEFINE_PAGE_4_STATUS <= '1') { ?>
            <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_4) . '">' . BOX_INFORMATION_PAGE_4 . '</a>'; ?></li>
<?php } ?>

         </ul></li>
     </ul>
</div>
<br class="clearBoth" />
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
</div>

Here is the second: your_template/ common/ tpl_box_default_sitemap.php
With this file there were no existing .php file to Winmerge.

<?php

// $Id: tpl_box_default_sitemap.php 2006-01-19 19:48:26Z a_berezin $
//
// Add includes/templates/template_default/common/tpl_box_default_sitemap.php 
// (you also may use YOUR_TEMPLATE)

// choose box images based on box position
 if ($title_link) {
  $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
 }
preg_match_all("'<a[^>]*>.*?</a>'si", $content, $href);
$url = zen_href_link(FILENAME_SITE_MAP);
for($i=0,$n=sizeof($href[0]);$i<$n;$i++) {
if(strpos($href[0][$i], $url)) {
 unset($href[0][$i]);
}
}

?>
  <li class="SiteMap"><?php echo $title; ?></li>
<?php
if(sizeof($href[0]) >0)
echo "<ul class=\"SiteMap\">\n<li class=\"SiteMap\">" . implode("</li>\n<li class=\"SiteMap\">", $href[0]) . "</li>\n</ul>\n";
?>
25 Apr 2010, 8:59 PM
#2
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: Missing <li> Tidy Error

haredo:

<!-- BOF: CODE TO add EZ-PAGES to Sitemap --> <li class="SiteMap">Step by Step Guides**</li>** **<ul** class="SiteMap"> <li class="SiteMap"><a href="includes/templates/hairbun/ezpages/bun/index.html" target="_blank">Bun</a></li>

There's two fixes, depending on what you want to achieve.

Either close the list and start a new one:

<!-- BOF: CODE TO add EZ-PAGES to Sitemap -->
<li class="SiteMap">Step by Step Guides[b]</li>[/b]
[b]</ul>[/b]
[b]<ul[/b] class="SiteMap">
<li class="SiteMap"><a href="includes/templates/hairbun/ezpages/bun/index.html" target="_blank">Bun</a></li>

Or if you want the new list to NEST inside the existing list, then remove the </li>:

<!-- BOF: CODE TO add EZ-PAGES to Sitemap -->
<li class="SiteMap">Step by Step Gui[b]des[/b]
  [b]<ul[/b] class="SiteMap">
    <li class="SiteMap"><a href="includes/templates/hairbun/ezpages/bun/index.html" target="_blank">Bun</a></li>
     ... 
    <li class="SiteMap"> ..... </li>
    <li class="SiteMap"> ..... </li>
  </ul>
[b]</li>[/b]
  ...
</ul>

But you will need to re-add it immediately after the closing </ul> of that "inner" list.

Lists behave like tables. It is not valid to start a new "inner" table after the end of a table cell, or after the end of a table row. The new table must start inside a table cell.

In the same way, a new "inner" list cannot begin after a list item. The new "inner" list must be wholly contained inside a single "parent" list item.

One related question. Why does every item, every <ul> and every <li> have a class name of sitemap? That's usually redundant.

Once the <ul> has a class of "sitemap" defined, the list item can be styled using ul.sitemap li { .. .. ..} without having to laboriously add the class="sitemap" attribute to every <li> tag. Use the power of the cascade. :smile:

25 Apr 2010, 10:17 PM
#3
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Missing <li> Tidy Error

G1,
Thank for the detail description of using <ul> and <li>...

My fix was this:

 <?php

// $Id: tpl_box_default_sitemap.php 2006-01-19 19:48:26Z a_berezin $
//
// Add includes/templates/template_default/common/tpl_box_default_sitemap.php 
// (you also may use YOUR_TEMPLATE)

// choose box images based on box position
 if ($title_link) {
  $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
 }
preg_match_all("'<a[^>]*>.*?</a>'si", $content, $href);
$url = zen_href_link(FILENAME_SITE_MAP);
for($i=0,$n=sizeof($href[0]);$i<$n;$i++) {
if(strpos($href[0][$i], $url)) {
 unset($href[0][$i]);
}
}

?>
  <li class="SiteMap"><?php echo $title; ?>
<?php
if(sizeof($href[0]) >0)
echo "<ul class=\"SiteMap\">\n<li class=\"SiteMap\">" . implode("</li>\n<li class=\"SiteMap\">", $href[0]) . "</li>\n</ul>\n";
?>  

I deleted the </li> here:

<li class="SiteMap"><?php echo $title; ?></li>
25 Apr 2010, 10:25 PM
#4
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: Missing <li> Tidy Error

But you didn't add one on the end, I think?