Support Forums

Old 01-15-2009, 02:39 AM   #1
Junior Member
 
Join Date: Jan 2009
Posts: 14
Rep Power: 2
naidu01 is on a distinguished road
Default How to auto populate category in search

I have added a category drop-down to my home page and all other pages. What I want now is the category drop-down to auto update when I click into a category and subcategory. Any help would be greatly appreciated.

I am running v4.0.9 hosted
naidu01 is offline   Reply With Quote
Old 01-15-2009, 05:40 AM   #2
Member
 
Join Date: May 2008
Posts: 84
Rep Power: 5
ombre is on a distinguished road
Default

Quote:
Originally Posted by naidu01 View Post
I have added a category drop-down to my home page and all other pages.

I am running v4.0.9 hosted
How have you do that .. can i see the code ? Thanks.
__________________
Version 4.0.9 - now live with 40.000 ads
ombre is offline   Reply With Quote
Old 01-15-2009, 08:29 AM   #3
Moderator
 
 
Join Date: Mar 2006
Posts: 4,110
Rep Power: 100
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by naidu01 View Post
I have added a category drop-down to my home page and all other pages. What I want now is the category drop-down to auto update when I click into a category and subcategory. Any help would be greatly appreciated.

I am running v4.0.9 hosted
If you notice when you click on a category the URL has "cat=catname" appended to it.

Then goto smarty.net and poke around a little bit you can see how you can use smarty to collect the cat variable from the URL.

Smarty

Then when you build your dropdown you can add smarty logic behind each option to say if the option value equals the cat value then set that option as selected.

<option value="MyCategory" {if $smarty.get.cat=="MyCategory"}selected{/if}>MyCategory</option>
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old 01-18-2009, 02:36 AM   #4
Junior Member
 
Join Date: Jan 2009
Posts: 14
Rep Power: 2
naidu01 is on a distinguished road
Default

This worked perfect. Thank you
naidu01 is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Preselected Category for Search Eric Barnes v4 Modules / Modifications 7 01-15-2009 09:17 PM
Search page with only 1 category sbhkma v4 Modules / Modifications 6 09-19-2008 11:13 AM
Had to re-upload files, now pages won't populate KBarnes_Aardvark v3.1 Questions & Support 4 09-02-2008 10:35 AM
Search auto-suggest teg v4 Modules / Modifications 2 03-31-2008 04:59 AM
Link to a certain category on search.php goldbear v3.0 Questions & Support 7 06-20-2007 03:51 AM


All times are GMT -4. The time now is 02:42 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0