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

Help Creating Dynamic Menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-28-2005, 03:04 PM
 
ian_fs ian_fs is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Norwich, UK
Posts: 86
 

Default Help Creating Dynamic Menu

I have been playing around with this for a little while now, but cannot quite get it to do what I want.

Code:
{capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if %position.first%} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {$categories[cat_num].category} {/section} {/if} {else} {if $subcategories NE ""} {section name=cat_num loop=$subcategories} {$subcategories[cat_num].category} {/section} {/if} {/if} {if %position.first% eq ""} {if $subcategories ne $location[position].1} {section name=cat_num loop=$subcategories} {$subcategories[cat_num].category} {/section} {/if} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

That is everything in my Categories.tpl file.

Now for some explanation (what should happen):-

When you first enter My Store, you will see the main categories horizontally laid out across the top as follows

Root Cat # 1 Root Cat #2 Root Cat #3


When you go to page level Root Cat #1 the menu should change too

Root Cat # 1 Root Cat # 2 Root Cat #3

RC#1 Sub 1 RC#1 Sub 2 RC#1 Sub 3 RC#1 Sub 4


Now when you enter RC#1 Sub 2 (equilevant of sub-level 2) the horizontal menu should change too:-

RC#1 Sub 1 RC#1 Sub 2 RC#1 Sub 3 RC#1 Sub 4

S1 1 S1 2 S1 3 -----[sub categories in RC#1 Sub 1]

Now if you enter S1 1 the top part of the menu would stay the same but the bottom level would then show, if any, the further sub categories.

Now there are the following issues:

1. Telling on HomePage to only show Root Categories

2. On Sub Cat 1 level there should be:

Top Level Menu - Shows Root Categories

Bottom Level Menu - Shows Sub Categories

3. When you enter Sub Category 1 level the Top Level Menu would take that of Sub Cateogry 1 level and no longer Root Categories, but from here on, Top Level Menu should always stay Sub Category 1 level.

But the Bottom Level Menu will continue to change when the subcategory levels get deeper.

So you could have this scenario:

Top Menu : Sub Category 1 Level

Bottom Menu : Sub Category 5 Level

Now at some point you will reach the last sub category and when you view that, the Bottom Menu should display the last Sub Category.

I hope you understand what I am trying to achieve, as what I have done so far is on the track but has not gone far enough down it yet.

I have also drawn a pretty picture which I have coloured in on paper of what it should look like, but my scanner has developed tendencies to show anything scanned in as bright pink. So I cannot show you my wonderful masterpiece.

Jez
__________________
X-Cart 4.0.17
Reply With Quote
  #2  
Old 01-28-2005, 04:30 PM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default

all sounds very confusing! Have you got a URL you can post to show us?
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote
  #3  
Old 01-28-2005, 10:45 PM
 
ian_fs ian_fs is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Norwich, UK
Posts: 86
 

Default

Here is the standard X-Cart with the only change being the Categories list placed horizontally across the middle:

http://www.sportlink.co.uk/infinitelimit/shop/home.php

Go through the CD and Dvd Category to CD Audio to Test Category.

As that is the deepest sub category.

At the moment they both change, the top and bottom menu.
__________________
X-Cart 4.0.17
Reply With Quote
  #4  
Old 01-29-2005, 08:17 AM
 
ian_fs ian_fs is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Norwich, UK
Posts: 86
 

Default

This is a clearer example of what I am trying to achieve using plain english.

Code:
For main menu:- if root show root categories else if location equals sub category level one or greater show subcategory level one end if end if For Submenu:- if root show nothing or show special file (which could be links to pages) else if location equals subcategory level one show nothing or show special file (which could be links to offers or new products or to pages) else show current location subcategories end if

The special files are there otherwise the sub-menu at certain stages would be blank, so to fill this in you could have links to the special offers section or the lastest products or even to pages (X-Cart built in HTML created pages)

I get the feeling that the Fancy Category style menu's are sort of what Im looking for, which are offered by X-Cart, but I feel reluctant to pay for it especially when it seems quite simple and I am only doing this as an experiment for a future project.

Jez
__________________
X-Cart 4.0.17
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 01:31 PM.

   

 
X-Cart forums © 2001-2020