How can I create search Dropdown list from Categories in News Module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

How can I create search Dropdown list from Categories in News Module

Post by Loopy »

Hi,

I've searched in the forums and while this seems to be almost answered in different places it doesn't quite explain how to do what I'm after. I want to create a dropdown list of categories from the News module that shows displays articles from select category. Does anybody have any ideas or maybe even done this before.

For example if I have a category named "Tutorials" any article in the Tutorials category will be display.

Hope somebody can help.

Thanks.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: How can I create search Dropdown list from Categories in News Module

Post by jmcgin51 »

I don't know if there is an "official" way to do it, but you could use the "browsecat" parameter for News, then capture the output of the module call, split it by spaces using Smarty, and populate the dropdown this way.

I'm sure there are much cleaner/faster ways, but if you need a solution ASAP, this should work. (UNTESTED)

In the future, perhaps the dev team will add a new parameter or argument, something like "action=dropdown"
Last edited by jmcgin51 on Mon Oct 12, 2009 5:42 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: How can I create search Dropdown list from Categories in News Module

Post by calguy1000 »

create a new browsecat template that builds a form, and a dropdown.... use javascript/jquery to handle the action.  it's quite simple.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

Re: How can I create search Dropdown list from Categories in News Module

Post by Loopy »

calguy1000 wrote: create a new browsecat template that builds a form, and a dropdown.... use javascript/jquery to handle the action.  it's quite simple.
Thanks for the replies and suggestions. My difficulty is I'm a complete novice to the code behind the code. I've used cmcms for a while and solved some basic problems I've met but for some reason this one is just getting away from me!
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: How can I create search Dropdown list from Categories in News Module

Post by jmcgin51 »

as I said
jmcgin51 wrote: I'm sure there are much cleaner/faster ways...
;)

Thanks, Calguy.
Loopy
Forum Members
Forum Members
Posts: 38
Joined: Sat Jun 10, 2006 5:34 pm

Re: How can I create search Dropdown list from Categories in News Module

Post by Loopy »

@jmcgin51, did you have any luck with this?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: How can I create search Dropdown list from Categories in News Module

Post by Dr.CSS »

Have you googled it?...

Is how I found out how to make a drop down select from menu manager...
Zoorlat

Re: How can I create search Dropdown list from Categories in News Module

Post by Zoorlat »

@Loopy

In case you are still looking, Calguy has posted a good tutorial on how to do this on his webiste:
http://calguy1000.com/Blogs/17/60/news-category-dropdown.html

Cheers
vzw klemtoon
Forum Members
Forum Members
Posts: 92
Joined: Mon May 14, 2007 11:31 am

Re: How can I create search Dropdown list from Categories in

Post by vzw klemtoon »

i'd love to know how to dropdown this list of cats with jquery...
and how to style it in css..

it parses

<form method="get">
<select name="news_category">
<option value="-1">All</option>
<option value="1" >General</option>
<option value="2" >concerten</option>
</select>

<input type="submit" name="submit" value="Submit"/>
</form>

how can one add classes to this?

thnx in advance.
Locked

Return to “Modules/Add-Ons”