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)
-   -   Hide Category Menu (https://forum.x-cart.com/showthread.php?t=24157)

ecommerce 08-16-2006 11:16 PM

Hide Category Menu
 
I would like to hide temporarily the Category Menu that is on the left side
when vistior is NOT in catalog (seeing a category, or seeing a product).

I only want the Category menu to show if visitor IS seeing a category or product. Else, is not available on the left side.

I thought about using this, but I don't know where and how to put it.

What file, and before and after what?

{if $main eq "catalog" and $current_category.category eq ""}

Thanks.

balinor 08-17-2006 02:34 AM

{if $main eq "catalog"}
code for categories menu
{/if}

ecommerce 08-17-2006 06:27 AM

I want it to be,

{if $main eq "catalog"}
{include categories.tpl}
{esle}
{include NEWMENU.tpl}
{/if}

Will the above code work?

and in what file and where in that file do I put it?

balinor 08-17-2006 06:29 AM

Not quite. Have a look at customer/home.tpl and you'll see where it goes:

{if $main eq "catalog"}
{include file="customer/categories.tpl"}
{else}
{include file="customer/newmenu.tpl"}
{/if}

ecommerce 08-17-2006 06:44 AM

Thanks, are there other "main" areas besides "catalog"?


And how do i know what they are, and what xcart calls them?


That way i can go show a specific menu based on the MAIN.

{if}
{if $main eq "catalog"}
{include file="customer/categories.tpl"} {/if}

{else}
{if $main eq "newmenuONE"}
{include file="customer/newmenuONE.tpl"} {/if}

{else}
{if $main eq "newmenuTWO"}
{include file="customer/newmenuTWO.tpl"} {/if}

{else}
{if $main eq "newmenuTHREE"}
{include file="customer/newmenuTHREE.tpl"} {/if}


{/if}

balinor 08-17-2006 06:50 AM

Look at customer/home_main.tpl, it will give you all sorts of $main areas :)

ecommerce 08-17-2006 06:56 AM

ur the man balinor!

did i write my if structure correctly?

i wrote it so that it makes sense to me, but i dont know if the syntax is correct.

balinor 08-17-2006 07:15 AM

You need to use {elseif} statements except for the last one, i.e.

{elseif $main eq "newmenuONE"}

ecommerce 09-12-2006 10:14 PM

Re: Hide Category Menu
 
What is this do /show/not show
Please break them down in simple terms

{if $main ne "catalog" or $current_category.category ne ""}


and how about this one

{if $main eq "catalog" and $current_category.category eq ""}

thanks.

ecommerce 09-12-2006 10:29 PM

Re: Hide Category Menu
 
Basically what Im trying to achieve is this

If your are in home page,
{include file=A.tpl"}

If NOT at home page,
{include file=B.tpl"}

If NOT at home page, but $main eq "manufacturers_list"
{include file=C.tpl"}

If NOT at home page, but $main eq "cart"
{include file=D.tpl"}

If NOT at home page, but $main eq "checkout"
{include file=E.tpl"}




What code will give me
At home page

and what code will give me
NOT at home page (meaning anywhere else).


All times are GMT -8. The time now is 12:39 PM.

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