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

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-09-2004, 12:17 AM
 
darrocm darrocm is offline
 

Member
  
Join Date: Oct 2004
Location: Walsall, West Midlands. UK
Posts: 12
 

Default 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.
__________________
Mike
---------------------
Live 4.0.7
Reply With Quote
  #2  
Old 12-09-2004, 05:49 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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

use that
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 12-09-2004, 06:47 AM
 
darrocm darrocm is offline
 

Member
  
Join Date: Oct 2004
Location: Walsall, West Midlands. UK
Posts: 12
 

Default

Shan,

That works like a charm. Bostin'
__________________
Mike
---------------------
Live 4.0.7
Reply With Quote
  #4  
Old 12-09-2004, 03:17 PM
 
elomibao elomibao is offline
 

Member
  
Join Date: Sep 2004
Posts: 24
 

Default

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}
__________________
X-Cart Pro 4.0.5
Fedora Core 2
Apache 2.x/PHP 4.x
MySQL 3.x
Reply With Quote
  #5  
Old 12-17-2004, 01:07 AM
 
GM GM is offline
 

eXpert
  
Join Date: Mar 2004
Location: Canada
Posts: 293
 

Default

This is definetly worth stashing in my bag of goodies for future reference, thanks guys.
__________________
v. 4.0.14 (GM Style)
O.S. Linux
Build Your Own Diamond Ring
Reply With Quote
  #6  
Old 12-22-2004, 08:39 AM
 
extremebykes extremebykes is offline
 

Member
  
Join Date: Dec 2004
Location: UK
Posts: 10
 

Default 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
__________________
Version 3.5.13
Reply With Quote
  #7  
Old 12-22-2004, 04:31 PM
 
elomibao elomibao is offline
 

Member
  
Join Date: Sep 2004
Posts: 24
 

Default

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.
__________________
X-Cart Pro 4.0.5
Fedora Core 2
Apache 2.x/PHP 4.x
MySQL 3.x
Reply With Quote
  #8  
Old 01-05-2005, 01:00 AM
 
clubsrefinished clubsrefinished is offline
 

Member
  
Join Date: Dec 2004
Location: West Midlands, UK
Posts: 15
 

Default

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}

__________________
Mike
--------------
Version: 4.0.11 Live, RMA, AOM & X-Affiliate
PHP 4.3.4
MySQL server 3.23.58
MySQL client 3.23.58
Web server Apache/1.3.29 (Unix)

Site: http://www.clubsrefinished.co.uk
Reply With Quote
  #9  
Old 01-07-2006, 06:38 PM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default

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
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #10  
Old 01-09-2006, 01:34 PM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default

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}

__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:33 AM.

   

 
X-Cart forums © 2001-2020