EE4 compatibility updates:
- Publisher is EE4 and EE5 compatible, but it does not currently support the Fluid field (it's in the works).
- Reel is EE4 and EE5 compatible, but it does not currently support the Fluid field.
Ticket: Multiple Channel Categories tags combining output
Status | Resolved |
Add-on / Version | Publisher 1.0.15 |
Severity | Critical |
EE Version | 2.7.2 |
Christian Maloney
Dec 12, 2013I have 2 category groups (ids 8 & 9) assigned to the same channel (although that doesn’t matter from my testing) and I want to output a separate list of each group in the same template. So I have:
<select>
{exp:channel:categories channel="support_download" category_group="8" show_empty="no" style="linear"}
<option value="{category_url_title}">{category_name}</option>
{/exp:channel:categories}
</select>
<select>
{exp:channel:categories channel="support_download" category_group="9" show_empty="no" style="linear"}
<option value="{category_url_title}">{category_name}</option>
{/exp:channel:categories}
</select>
I should get one list with c5t, CL910 and F5t and another list with only Windows 7 like below:
<select>
<option value="c5t">c5t</option>
<option value="cl910">CL910</option>
<option value="f5t">F5t</option>
</select>
<select>
<option value="windows-7">Windows 7</option>
</select>
But the second tag is outputting all of the categories combined:
<select>
<option value="c5t">c5t</option>
<option value="cl910">CL910</option>
<option value="f5t">F5t</option>
</select>
<select>
<option value="c5t">c5t</option>
<option value="cl910">CL910</option>
<option value="f5t">F5t</option>
<option value="windows-7">Windows 7</option>
</select>
I dumped the $this->cat_array variable on line 382 of Publisher_channel_categories.php and Publisher is definitely loading the categories combined into one array in the second tag. I also tried the same tags without publisher enabled and they worked as expected (There was no combining of categories). I test with the tags exactly as written above with nothing else in the template.
BoldMinded (Deprecated)
Christian, thanks for sending this. I won’t be able to dive into this until this weekend though.
Christian Maloney
I also tried loading both tags from separate embeds and still got the combined categories.
Christian Maloney
No worries, I can work around it for now. Let me know if you need any other info or if there is some additional testing I can do that would help.
BoldMinded (Deprecated)
Easy fix. On line 243 of that file just before the foreach loop add this:
Christian Maloney
Glad it was an easy one. Thanks!