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

only show parent category in channel form

Development and Programming

Eastwood Design's avatar
Eastwood Design
605 posts
8 years ago
Eastwood Design's avatar Eastwood Design

How do I only show the parent categories in the channel form?

With the code below I am getting both parent and children categories

{exp:channel:form channel="training_institutions" url_title="{segment_3}" author_only="yes"  datepicker="no" return="training-program/update/success"}
{category_menu}
  <label for="categories">Country</label>
<select name="category[]" id="categories">
  {categories}
    <option value="{category_id}"{selected}>{category_name}</option>
  {/categories}
</select>

       
{/category_menu}

{/exp:channel:form}
       
Rob Allen's avatar
Rob Allen
2,950 posts
8 years ago
Rob Allen's avatar Rob Allen

Not tested by try replacing the

{category_menu}

tag with the native

{exp:channel:categories}

tag, possible via an embed template.

       

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.