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

Drop Down Menu For Categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-16-2009, 10:04 AM
 
thefizix thefizix is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: San Deezy
Posts: 46
 

Default Drop Down Menu For Categories

I have read a previous thread about creating a drop down menu for the categories.tpl. I am able to view the category drop down, but the text is not visible and when clicked on redirects to the home page. Code Shown Below...

{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
<form name="form_cat" method="get" action="home.php">
<select name="cat" onChange="document.form_cat.submit()">
<option value="0" selected>Search By Category</option>
{section name=cat_num loop=$categories}
<option value="home.php?cat={$c.categoryid}">{$categories[cat_num].category}</option>
{/section}
</select>
</form>
{else}
{section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font>

{/section}
{/if}
{/if}


{/capture}
{include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu}
__________________
Conrad 'Rick' Alberto
San Diego, CA
www.TheFizix.com

X-Cart version 4.1.9
Reply With Quote
  #2  
Old 02-16-2009, 10:04 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Drop Down Menu For Categories

Please don't post questions in the completed custom mods forum. Moving to Template Editing.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-17-2009, 04:10 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Drop Down Menu For Categories

Code:
{section name=cat_num loop=$categories} <option value="{$c.categoryid}">{$categories[cat_num].category}</option> {/section}

Use this section code instead of your variant.
Reply With Quote
  #4  
Old 02-18-2009, 09:51 PM
 
thefizix thefizix is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: San Deezy
Posts: 46
 

Default Re: Drop Down Menu For Categories

I am still getting the same issue. I have attached a screenshot. Basically the form box opens but the font is not visible and when clicked on it redirects me to a homepage and not to a specific category.
Attached Thumbnails
Click image for larger version

Name:	Picture 1.png
Views:	244
Size:	33.3 KB
ID:	1377  
__________________
Conrad 'Rick' Alberto
San Diego, CA
www.TheFizix.com

X-Cart version 4.1.9
Reply With Quote
  #5  
Old 02-19-2009, 03:39 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Drop Down Menu For Categories

Code:
<form method="get" action="home.php"> <select name="cat" onchange="this.form.submit()"> <option value="0"{if $cat eq "0"} selected{/if}>{$lng.lbl_categories}...</option> {foreach from=$categories item=c} <option value="{$c.categoryid}"{if $cat eq $c.categoryid} selected{/if}>{$c.category}</option> {/foreach} </select> </form>
__________________
xcartmods.co.uk
Reply With Quote
  #6  
Old 02-19-2009, 04:19 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: Drop Down Menu For Categories

Yes, PhilJ is right. I've copied code of "section" and did not checked, is it right. There is foreach should be.
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
Reply With Quote
  #7  
Old 02-20-2009, 09:14 AM
 
thefizix thefizix is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: San Deezy
Posts: 46
 

Default Re: Drop Down Menu For Categories

Thanks alot guys! It works!
__________________
Conrad 'Rick' Alberto
San Diego, CA
www.TheFizix.com

X-Cart version 4.1.9
Reply With Quote
  #8  
Old 05-12-2009, 12:16 PM
 
dpm dpm is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 43
 

Default Re: Drop Down Menu For Categories

Does this work with SEO friendly URL's? When I change the drop down I get a domian.com/?cat=285 instead of what it should be.
__________________
x-cart-4.1.8gold
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 08:46 PM.

   

 
X-Cart forums © 2001-2020