EllisLab text mark
Advanced Search
     
format nested categories in dropdown
Posted: 18 October 2008 06:55 PM   [ Ignore ]
Joined: 2008-04-29
83 posts

Hi,

Hopefully someone can help me out with the following:

I want to use a category list with sub categories on the side bar for navigation. The sub category should have an indent. I get this to work with the following code:

{exp:weblog:categories weblog="jobs" style="nested" status="open"}
<a href="{path=jobs}">{category_name}</a>
{/exp:weblog:categories} 

But I also want a drop down list for the categories and therefore use the following code:

<form name="catmenu" action="">
<
select name="selcat">
<
option value="">--Select Category--</option>
{exp:weblog:categories weblog="jobs" style="nested" status=>"open"}
<option value="{path=jobs}">{category_name}</option>
{/exp:weblog:categories}
</select>
</
form

Unfortunatly it shows just a straight list with head and sub categories. I think it has to do with the css tags but tried to apply it without any luck.

Any help in this would be great.

Regard,
Tammo

 
Posted: 18 October 2008 07:33 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-10-22
1643 posts

Maybe this is what you are looking for.

 Signature 

utilitEEs - Addons for EE

 
Posted: 18 October 2008 08:13 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2008-04-29
83 posts

Hi Silenz,

Thanks for your reply, I tried the plugin and it seems to be able to do what I want. I had to adapt the example and I think I am nearly there. One thing I need to solve is that whenever I click on any of the categories the drop down selection will jump back to the first top category instead of showing the page with the category entries.

My code is:

<div class="block news">
<
h2>Job Categories</h2>
<
div class="content">
<
form name="catmenu" action="">
<
select name="selcat">
{exp:textnest fill="&nbsp;&nbsp;"}
{exp
:weblog:categories weblog="jobs" category_group="4" style="nested"}
<option value="{path=jobs}">{exp:xml_encode}{category_name}{/exp:xml_encode}</option>
{/exp:weblog:categories}
{
/exp:textnest}
</select>
</
form
</
div>
</
div

Hope you can help to solve the last bit.

Cheers,
Tammo