In this example, we would like to achieve two things:
- Only show categories in category_group 2
- Exclude the category with category_id 68
<div class="form-group">
<label for="title">Categories</label> <br>
<select name="category[]" id="categories">
{categories show_group="2"}
{if {category_id} != 68}
<option value="{category_id}"{selected}>
{category_name}
</option>
{/if}
{/categories}
</select>
</div>
Post a comment on
ExpressionEngine categories loop: Filter by group_id and category_id