View Single Post
  #6  
Old 07-13-2007, 12:59 PM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Re: 4 Level SEO friendly Flyout Menus

4.1.X requires major code changes in order for the categories to display. The following is based off of what others have posted (I just extended it to 4 levels deep). The associated CSS can be generated/found here and be sure to add this. I've named mine "flyout" but I believe the link named it something else so be sure to change it to match. This is still somewhat of a work-in-progress, for me IE has display issues (ie note how the root level looks compared to the other levels) but maybe it won't be a major problem if you know your way around CSS which I don't. If you want to work around with it, I'd love to see it fixed up!

The code is just what I did and it "should" work. I'm still looking to make it more efficient or remove any unnecessary code. For numerous categories, you can generate a static one and place it in, but you'll probably have to update it continuously (depending on how you configured your product options) - this is dynamic. Very similar to what's offered here but is done with what was provided on the forum, a little tweaking of my own, and the CSS site I linked above - I think in my version it fixes up some minor HTML issues that exists in the XCartMods one (such as empty LI / UL / etc).

Works with CDSEO to the best of my knowledge. Completely CSS driven (I think :P)
Root
- Level 1
- Level 2
- Level 3

Code:
<div class="flyout"> <ul> {foreach from=$categories item=cRoot name="RootCat"} {assign var=in value=$cRoot.categoryid} {if $allsubcategories.$in ne ''} {if $smarty.foreach.RootCat.last} <li><a href="home.php?cat={$cRoot.categoryid}" class="flyoutlast"><b>»</b>{$cRoot.category|escape:'html'}<!--[if IE 7]> {else} <li><a href="home.php?cat={$cRoot.categoryid}"><b>»</b>{$cRoot.category|escape:'html'}<!--[if IE 7]> {/if} {else} {if $smarty.foreach.RootCat.last} <li><a href="home.php?cat={$cRoot.categoryid}" class="flyoutlast">{$cRoot.category|escape:'html'}<!--[if IE 7]> {else} <li><a href="home.php?cat={$cRoot.categoryid}">{$cRoot.category|escape:'html'}<!--[if IE 7]> {/if} {/if} <!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--> {if $allsubcategories.$in ne ''} <ul> {foreach from=$allsubcategories.$in item=sc1 name="SubCategory_Level1"} {assign var=in2 value=$sc1.categoryid} {if $allsubcategories.$in2 ne ''} {if $smarty.foreach.SubCategory_Level1.last} <li><a href="home.php?cat={$sc1.categoryid}" class="flyoutlast"><b>»</b>{$sc1.category|escape:'html'}<!--[if IE 7]> {else} <li><a href="home.php?cat={$sc1.categoryid}"><b>»</b>{$sc1.category|escape:'html'}<!--[if IE 7]> {/if} {else} {if $smarty.foreach.SubCategory_Level1.last} <li><a href="home.php?cat={$sc1.categoryid}" class="flyoutlast">{$sc1.category|escape:'html'}<!--[if IE 7]> {else} <li><a href="home.php?cat={$sc1.categoryid}">{$sc1.category|escape:'html'}<!--[if IE 7]> {/if} {/if} <!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--> {if $allsubcategories.$in2 ne ''} <ul> {foreach from=$allsubcategories.$in2 item=sc2 name="SubCategory_Level2"} {if $smarty.foreach.SubCategory_Level2.last} <li><a href="home.php?cat={$sc2.categoryid}" class="flyoutlast">{$sc2.category|escape:'html'}</a></li> {else} <li><a href="home.php?cat={$sc2.categoryid}">{$sc2.category|escape:'html'}</a></li> {/if} {/foreach} </ul> {/if} <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> {/foreach} </ul> {/if} <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> {/foreach} </ul> </div>
__________________
4.1.8
Reply With Quote