X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Horizontal 'Categories' and/or 'Manufacturers' Menu Query (https://forum.x-cart.com/showthread.php?t=10834)

darrocm 12-09-2004 12:17 AM

Horizontal 'Categories' and/or 'Manufacturers' Menu Query
 
Hi,

I was looking to change the 'Categories' and/or 'Manufacturers' side menu to display as a horizontal navigation bar within the head.tpl.

I realise that by far the easiest way would be to simply create a html table within head.tpl and populate it with the links but I would like to still be able to alter the menu within the admin section i.e. if I add a new category it will automatically add it to the 'Category' list as it does by default but for it to display horizontally rather than vertically.

I have searched the 'Custom Mods & Templates' & others section but could not find anything that would work for the latest branch of xcart.

Any assistance would be greatly appreciated.

shan 12-09-2004 05:49 AM

Code:

{section name=cat_num loop=$categories}
<FONT class="CategoriesList">{$categories[cat_num].category} | </FONT>
{/section}


use that

darrocm 12-09-2004 06:47 AM

Shan,

That works like a charm. Bostin' :D

elomibao 12-09-2004 03:17 PM

Quote:

Originally Posted by shan
Code:

{section name=cat_num loop=$categories}
<FONT class="CategoriesList">{$categories[cat_num].category} | </FONT>
{/section}


use that


The only problem is you get an extra "|" char at the end of the last category. I modified it and added a test:

Code:

{section name=cat_num loop=$categories}
<FONT class="CategoriesList">{$categories[cat_num].category}{if not %cat_num.last%} | {/if}</FONT>
{/section}


GM 12-17-2004 01:07 AM

This is definetly worth stashing in my bag of goodies for future reference, thanks guys. :wink:

extremebykes 12-22-2004 08:39 AM

which .tpl does this code relate to please
 
hi sorry to be so ignorant.....which .tpl is this code referring to ?
I've ran a find search using snippets of the code of the source ..without finding which .tpl it relates to.
Any guidance appreciated.
thanks
chris

elomibao 12-22-2004 04:31 PM

The original poster wanted the categories printed at the top in a horizontal manner and the only place to put it is in the head.tpl.

clubsrefinished 01-05-2005 01:00 AM

For reference if you want the Manufactuers list to display horizontally you can use this code.

{section name=mid loop=$manufacturers_menu}
{$manufacturers_menu[mid].manufacturer}{if not %mid.last%} | {/if}</FONT>
{/section}

:wink:

dalmuti 01-07-2006 06:38 PM

Digging up an old topic...but with a new twist because of 4.1 Beta 2.

Here is the file:

Code:

{if $config.General.root_categories eq "Y"}
{foreach from=$categories item=c}
<font color="ffffff">{$c.category}{if not %categories.last%}&bull;{/if}</font>{/foreach}
{else}
{foreach from=$subcategories item=c key=catid}
<font color="ffffff">{$c.category}{if not %categories.last%}&bull;{/if}</font>
{/foreach}
{/if}


I am trying to eliminate the last bullet after the category list and {if not %categories.last%} does not work??? Any suggestions?

Thanks,
Louise

dalmuti 01-09-2006 01:34 PM

Just FYI - figured it out.....correct would be:

Code:

{if $config.General.root_categories eq "Y"}
{foreach from=$categories item=c name=categs}
<font color="#ffffff">{$c.category}
{if not $smarty.foreach.categs.last}&bull;{/if}</font>
{/foreach}
{/if}


:lol: :lol:


All times are GMT -8. The time now is 08:51 AM.

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