0

I'm trying to display a custom field within a categories loop (Channel Form). The {category_name} outputs just fine but ExpressionEngine refuses to render the custom field {category_custom_field}. (The custom field does work with exp:channel:categories.)

{categories show_group="5" parse="inward"}
  <option value="{category_id}" {selected}>
    {category_custom_field}
  </option>
{/categories}
2

As per the docs for the Channel Form custom fields are not loaded.

You mention the solution though, we can wrap the bit where you need the custom field in an exp:channel:categories tag so you can load the custom tags. We do it this way so we can preserve the selected tags too

{categories show_group="5" parse="inward"}
  <option value="{category_id}" {selected}>
      {exp:channel:categories channel="1" style="linear" show="{category_id}"}
        {category_custom_field}
      {/exp:channel:categories}
  </option>
{/categories}

You don't quote what channel the entry form is for so I use 1 in the example above.

| improve this answer | |
  • Awesome! Thanks so much for your help Blatant :) – Franz Jun 17 '15 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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