Forum
Perch if: more than one category
Hi, right now I have an h5 fed with post categories.
<h5><?php perch_blog_post_categories(perch_get('s'), array('template' => 'category_link.html')); ?></h5>
category_link.html
<perch:category id="catTitle" />
But they display all words together <h5>FootbalBasketball</h5>
and I would like to make a conditional so it can go <h5>Football & Basketball</h5>
and if there is only one category then go `<h5>Football</h5>``
Any ideas?
Hi,
I think you need to remove the
<h5>
tags from your page, and then do something like this in your template:Not tested but I think this is pretty much right...
Hi Mike, it still gives
<h5>Football Basket</h5>
without&
...Hm maybe try
Yeah! Thanks Mike!
No worries - looks like the not-exists doesn't work in categories
Mike (and Raul)
Might work - Mike, you used !perch_item_last instead of not-exists... ;-)
Sounds good!
Haha thanks - I need some more sleep!