Forum

Thread tagged as: Question

Categories - Getting Set Title, and Category count

What code would I use to get the Category Title to appear above my list of categories? This is my current code which is not working.

?php perch_categories( array(
  'template'=>'category_nav.html',
  'set' => 'product-type',
  'include-empty' => false
  ));
?>

NavTemplate

<perch:before>
<div class="sidebox">
<h3><perch:categories id="setTitle" type="smarttext" label="Title" required="true" /></h3><!--THIS IS WHERE I WANT THE SET TITLE-->
<div class="pad5">
<ul class="categories">
</perch:before>
    <li><a href="category.php?cat=<perch:category id="catPath" />"><perch:category id="catTitle" type="smarttext" label="Title" required="true" /></a></li>
<perch:after>
</ul>     
</div><!-- /.pad5 -->
</div><!-- /.sidebox -->  
</perch:after>

Also how can I show a category count in brackets next to the filters similar to how blog does on the filters.

James Tedder

James Tedder 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The category title is

<perch:category id="catTitle" type="smarttext" />

Drew McLellan said:

The category title is

<perch:category id="catTitle" type="smarttext" />

Sorry I meant the setTitle

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think we have a way to do that.

How about the count for Category items like in blog categories?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are your blog categories not currently showing a count?

I am using the Categories app with products in a 2 page List-Detail setup. It lists the categories on the side so users can filter but I want to show how many items are tagged in each category.

Drew McLellan

Drew McLellan 2638 points
Perch Support

We don't currently have a way to get the count of categories limited to just that scope.