3

I am having trouble displaying checkboxes for a P&T Field Pack Checkboxes custom field in a Channel Form (ExpressionEngine 2.7.1, Field Pack 2.1.1) using the {custom_fields} and {options} loop.

I've simplified this example, but using the following code nothing is displayed.

{custom_fields}
  {if field_name=='preferred_position'}
    {options}
      {option_name}
      <input
        type="checkbox"
        name="{field_name}[]"
        value="{option_value}"
      >
    {/options}
  {/if}
{/custom_fields}

And the corresponding Field Options:

1 : Driver
2 : Cook
3 : Bartender

In earlier versions of EE (back when it was Safecracker), my loop looked like this:

{preferred_position:options}
  {option_name}
  <input
    type="checkbox"
    name="preferred_position[]"
    value="{option_value}"
  >
{/preferred_position:options}

Are the P&T fieldtypes unsupported by {custom_fields}?

1
4

Any time i've used it P&T fields so far i've gone with this syntax:

{field:preferred_position}

I haven't specifically used checkboxes, but I think its worth a shot.

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.