0

Is it possible to edit categories against an entry using ExpressionEngine Channel Forms?

The {selected} variable doesn't seem to be getting set, so it's always resetting back to the first category in the select drop down.

<select name="category[]" id="categories">
   {exp:channel:categories category_group="3"}
   <option value="{category_id}" {selected}>{category_name}</option>
   {/exp:channel:categories}
</select>

I'm using EE2.9.0, and no upgrading is not an option. Also, yes I've used Channel Forms before and it's all working aside from this. Thanks!

1 Answer 1

1

The documentation would lead me to suggest using the native {category_menu} variable pair.

http://ee2docs.com/add-ons/channel/channel_form/index.html#categories

This is the example from the docs:

{category_menu}
    <label for="categories">Categories</label>
    <select name="category[]" id="categories" size="4" multiple="multiple">
        {select_options}
    </select>
{/category_menu}

That should do it.

2
  • You're absolutely right. How did I miss that? Thank you.
    – JamesNZ
    Commented Nov 14, 2015 at 21:34
  • It happens! I just happen to be a master doc scanner :p glad it worked though!
    – jrothafer
    Commented Nov 14, 2015 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.