X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Help Creating Dynamic Menu (https://forum.x-cart.com/showthread.php?t=11792)

ian_fs 01-28-2005 03:04 PM

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

donavichi 01-28-2005 04:30 PM

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

ian_fs 01-28-2005 10:45 PM

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.

ian_fs 01-29-2005 08:17 AM

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


All times are GMT -8. The time now is 05:53 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.