0

I'm trying to build a channel form for updating channel entry data. In this scenario, I'm relating a farmer to multiple butchers.

{exp:zoo_visitor:update_form}
    ...
    <ul id="slaughterhouses">
        <li class="selected">
            <label>{f_butchers:title}</label>
            <input type="checkbox" name="f_butchers[data][]" value="{f_butchers:entry_id}" checked/>
        </li>
    </ul>
    ...
{/exp:zoo_visitor:update_form}

This entry currently has 2 selected butcher entries selected. But only one is rendered on the template. I've tried wrapping the <li> element in {f_butchers} pair tags to no avail.

In fact, wrapping them in f_butcher pair tags breaks the template parser and I get {f_butchers:title} instead of the actual butcher title. But once I wrap those pair tags in the {exp:zoo_visitor:details} pair tag, I get the one entry again. Still doesn't output the second entry.

The default {field:f_butchers} won't be enough since I need to do custom styling.

Does anyone know how to correctly template this field data?

1 Answer 1

0

... broheim, you have to use relationships as a variable pair to loop over it, otherwise it just outputs one entry:

{exp:zoo_visitor:update_form}
    ...
    <ul id="slaughterhouses">
        {f_butchers}
        <li class="selected">
            <label>{f_butchers:title}</label>
            <input type="checkbox" name="f_butchers[data][]" value="    {f_butchers:entry_id}" checked/>
        </li>
        {/f_butchers}
    </ul>
    ...
{/exp:zoo_visitor:update_form}

Edit

Ok... stupid question, but are you sure both relationship entries have a status that is displayable, IE, status = Open ?

2
  • I did that. Same exact output. One entry instead of two. Aug 10, 2015 at 17:37
  • Okay: both entries are status=open. And both butchers are associated with the entry (confirmed from the control panel). Aug 10, 2015 at 17:41

Your Answer

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

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