Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

4 Level SEO friendly Flyout Menus

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 07-16-2007, 04:24 AM
 
exsecror exsecror is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,284
 

Default Re: 4 Level SEO friendly Flyout Menus

Quote:
Originally Posted by JWait
Ok, you've made me curious, what other form of navigation are you using?

We made some particular modifications into how navigation of categories, sub-categories and products go with X-Cart's logic. First off we keep our sidebar menu for categories pretty much the standard one, except that it doesn't keep root categories it follows the user as they go deeper into our tree. Second I made code modifications to products.php and product.php to ensure that the category menu still displays no matter what (in this case it displays the last level they were in when they visited the products).

The other is we modified how a user browses our site, instead of constantly using the sidebar menu I made modifications to subcategories.tpl (and cloned it for the welcome.tpl file) that displays a list of categories and then their subcategories or products in a column'd list. This makes for much easier navigation in our site. A screenshot of what it looks like with both categories that have subcategories and categories that only have products occupying the same tree.

We also limit the list of products in this layout to about no more than 6 to prevent severe flooding.
Attached Thumbnails
Click image for larger version

Name:	layout.jpg
Views:	289
Size:	63.8 KB
ID:	463  
Reply With Quote

The following user thanks exsecror for this useful post:
JWait (08-25-2009)
  #12  
Old 07-16-2007, 10:23 AM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Re: 4 Level SEO friendly Flyout Menus

Quote:
Originally Posted by 1CNS
Thanks nevets1219, I got further with that under 4.1.8 than with the Alltribes solution. You're referencing a class called "flyoutlast" that doesn't appear in the CSS you reference (which has one class, called menu). Is there a way you can post the CSS you used? It looks like the web reference you provide might contain a different or updated CSS.

Thanks.

The 2nd link in my post (found here) has mentioned a "last" and that's where I got it from. I hope I used it correctly. My CSS is essentially the one generated from the Menu Builder and that other paged linked above. To be honest, I didn't really pay attention to see what display changes it made though :P

On a side note, I've used "escape" modifiers in my code, it might screw up the display of your categories depending on what you have (ie your categories should have & and not & otherwise the 'escape' modifier will screw things up). Remove it as you feel necessary.

PhilJ, glad your version is one step closer to perfection if it's not already there
__________________
4.1.8
Reply With Quote
  #13  
Old 07-16-2007, 06:54 PM
  flyclothing's Avatar 
flyclothing flyclothing is offline
 

eXpert
  
Join Date: Aug 2004
Location: Gilbert, AZ
Posts: 357
 

Default Re: 4 Level SEO friendly Flyout Menus

I was looking for something just like this! What would I need to do to make this function within my current template and categories? I replaced the { include file="customer/categories.tpl" } with the { include file="menu/menu.tpl" } and lost the categories layout of the website.
__________________
Jonathan
Flyclothing, LLC
PO Box 1490
Gilbert, AZ 85299-1571
P 480.422.7350
F 888.359.2568
www.flysportsgear.com?MMCF_xcartforum (X-Cart 4.5.2) FOR SALE
Reply With Quote
  #14  
Old 07-17-2007, 08:30 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default Re: 4 Level SEO friendly Flyout Menus

To use this in 4.1x you just need to fix the menu.tpl to display your categories as an unordered list. The CSS and JS should work the same. There is no need for any tables or IE conditional statements if you use the CSS and JS I provided.
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #15  
Old 07-17-2007, 09:31 PM
  flyclothing's Avatar 
flyclothing flyclothing is offline
 

eXpert
  
Join Date: Aug 2004
Location: Gilbert, AZ
Posts: 357
 

Default Re: 4 Level SEO friendly Flyout Menus

Thank you for the reply. I realized from your response I had the wrong version of X-Cart listed. I actually have 4.0.13. Would the needed changes be the same?
__________________
Jonathan
Flyclothing, LLC
PO Box 1490
Gilbert, AZ 85299-1571
P 480.422.7350
F 888.359.2568
www.flysportsgear.com?MMCF_xcartforum (X-Cart 4.5.2) FOR SALE
Reply With Quote
  #16  
Old 07-18-2007, 09:09 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: 4 Level SEO friendly Flyout Menus

alltribes, nice mod, but doesn't work properly in 4.1.8 (as "$allcategories" doesn't list all of the categories by default in 4.1.

also, the template itself could be cleaned up a bit as well. i'll post a revised copy later
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #17  
Old 07-18-2007, 09:48 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default Re: 4 Level SEO friendly Flyout Menus

Quote:
Originally Posted by flyclothing
Thank you for the reply. I realized from your response I had the wrong version of X-Cart listed. I actually have 4.0.13. Would the needed changes be the same?

Hmm, it should work. Does anything at all show up?
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #18  
Old 07-18-2007, 11:22 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: 4 Level SEO friendly Flyout Menus

yes, the "current" level of categories are retrieved, but not all, so it doesn't recurse deeper

in 4.1, the request for the categories array is handled by this bit of code:
Code:
# # Gather the array of categories and extract into separated arrays: # $all_categories, $categories and $subcategories # if (($current_area == "C" && defined("GET_ALL_CATEGORIES")) || defined('MANAGE_CATEGORIES')) { $_categories = func_get_categories_list($cat); } elseif($current_area == "C") { $_categories = func_get_categories_list($cat, true, "current"); } else { $_categories = func_get_categories_list($cat, true, "all"); }

note the
Quote:
defined("GET_ALL_CATEGORIES")
bit of code

the only place i found GET_ALL_CATEGORIES defined was in search.php, so for my site, I added the define to the top of home.php:
Code:
define("GET_ALL_CATEGORIES",true);

that fixed up the need for the nested categories. i also fixed up some of the logic (if statements) in the code. i'll prepare a proper post tonight with full instructions (will be similar to your first post)
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #19  
Old 07-19-2007, 03:59 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: 4 Level SEO friendly Flyout Menus

Posted this thread for your mod, for 4.1.x, you can see my code changes there, and I gave full credit to you

http://forum.x-cart.com/showthread.php?p=178820
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #20  
Old 09-19-2007, 09:35 PM
  flyclothing's Avatar 
flyclothing flyclothing is offline
 

eXpert
  
Join Date: Aug 2004
Location: Gilbert, AZ
Posts: 357
 

Default Re: 4 Level SEO friendly Flyout Menus

alltribes,

Thank you for the great mod! I am trying to integrate this with my current layout. Here are the two templates. How can I mix these two templates to match my current layout?

CATEGORY TEMPLATE (CURRENT CATEGORY TEMPLATE)

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
<div id="categories">
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
<FONT class="CategoriesList"><A href="{seo_link cat_name=$categories[cat_num].category cat_id=$categories[cat_num].categoryid}" class="VertMenuItems_top">{$categories[cat_num].category}</A></FONT>
{else}
<FONT class="CategoriesList"><A href="home.php?cat={$categories[cat_num].categoryid}" class="VertMenuItems_top">{$categories[cat_num].category}</A></FONT>
{/if}
{* END SAFETYNET DSEFU MOD *}
{/section}
{else} {section name=cat_num loop=$subcategories}
{if $enable_seo_links == "Y"}
<FONT class="CategoriesList"><A href="{seo_link cat_name=$subcategories[cat_num].category cat_id=$subcategories[cat_num].categoryid}" class="VertMenuItems_top">{$subcategories[cat_num].category}</A></FONT>
{else}
<FONT class="CategoriesList"><A href="home.php?cat={$subcategories[cat_num].categoryid}" class="VertMenuItems_top">{$subcategories[cat_num].category}</A></FONT>
{/if}
{* END SAFETYNET DSEFU MOD *}
{/section}
{/if}
{/if}
{/capture}
{ include file="menu_categories.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }
</div>

MENU TEMPLATE (YOUR MOD)

<ul id="navmenu">
{section name=l1_cat_num loop=$categories}
{if $categories[l1_cat_num].parentid eq 0}
<li><a href="home.php?cat={$categories[l1_cat_num].categoryid}" alt="{$categories[l1_cat_num].category}">{$categories[l1_cat_num].category}{if $categories[l1_cat_num].subcategory_count gt 0}+</a>{else}</a></li>{/if}
{if $categories[l1_cat_num].subcategory_count gt 0}
<ul>
{section name=l2_cat_num loop=$allcategories}
{if $allcategories[l2_cat_num].parentid eq $categories[l1_cat_num].categoryid}
<li><a href="home.php?cat={$allcategories[l2_cat_num].categoryid}" alt="{$allcategories[l2_cat_num].category}">{$allcategories[l2_cat_num].category}{if $allcategories[l2_cat_num].subcategory_count gt 0}+</a>{else}</a></li>{/if}
{if $allcategories[l2_cat_num].subcategory_count gt 0}
<ul>
{section name=l3_cat_num loop=$allcategories}
{if $allcategories[l3_cat_num].parentid eq $allcategories[l2_cat_num].categoryid}
<li><a href="home.php?cat={$allcategories[l3_cat_num].categoryid}" alt="{$allcategories[l3_cat_num].category}">{$allcategories[l3_cat_num].category}{if $allcategories[l3_cat_num].subcategory_count gt 0}+</a>{else}</a></li>{/if}
{if $allcategories[l3_cat_num].subcategory_count gt 0}
<ul>
{section name=l4_cat_num loop=$allcategories}
{if $allcategories[l4_cat_num].parentid eq $allcategories[l3_cat_num].categoryid}
<li><a href="home.php?cat={$allcategories[l4_cat_num].categoryid}" alt="{$allcategories[l4_cat_num].category}">{$allcategories[l4_cat_num].category}</a></li>
{/if}{/section}</ul></li>
{/if}{/if}{/section}</ul></li>
{/if}{/if}{/section}</ul></li>
{/if}{/if}{/section}</ul>
__________________
Jonathan
Flyclothing, LLC
PO Box 1490
Gilbert, AZ 85299-1571
P 480.422.7350
F 888.359.2568
www.flysportsgear.com?MMCF_xcartforum (X-Cart 4.5.2) FOR SALE
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:11 PM.

   

 
X-Cart forums © 2001-2020