We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How to show a dropdown list for a category.

How Do I?

Dang Ho's avatar
Dang Ho
1 posts
7 years ago
Dang Ho's avatar Dang Ho

Hello all and thank you your help.

Can you please point me into the right direction with the following scenario?

I have a Category Group called “automobile” and category Tesla, Toyota, Ford, Honda, etc… How can I add a list of model cars to my categories?… for ex:

If I want to add an entry into my channel I select category Tesla and I would like (when I select this category) to attache a list of models displayed only to this category… can this be done? Thank you all for reading this. B.

       
bobural's avatar
bobural
20 posts
7 years ago
bobural's avatar bobural

Hi,

There are a few ways I believe. Relationships, query or categories and subcategories. In your case I believe you have main category Tesla, and subcategory Model X

The code will be something like this i think…

<select>
    {exp:channel:categories channel="your_channel_name_here"}
    {if parent_id == 'your_Tesla_main_category_ID_here'}
    <option value="{category_url_title}">{category_name}</option>
    {/if}
    {/exp:channel:categories}
    </select>

have a look at the documentation maybe it will help more…

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

It actually sounds to me like you’d be better off with Relationships, as your car makers are no longer just taxonomy, but are needing to contain content. So you’d have a manufacturers and a make/model channel, which would relate to that.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.