Forum

Thread tagged as: Question

How do I use different category sets in the blog app

Hi,

I want to use different category sets in the blog app, but for some reason it only shows the "blog" set already setup.

Also, does the number of posts in a category not show if you don't use the blog set?

Thanks

Paul Langley

Paul Langley 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can add new category fields to the post.html template using any of your configured sets. Totals are only tallied by the Blog app for the default Blog category set.

Hi

I am trying to output a set of categories to use as filters on the blog.

I have set up categories with sub categories:

Industry    success-stories/industry/   Delete
 Creative & Digital success-stories/industry/creative-digital/  Delete
 Food & Drink   success-stories/industry/food-drink/    Delete
 Engineering & Manufacturing    success-stories/industry/engineering-manufacturing/ Delete
 Health & Life Sciences success-stories/industry/health-life-sciences/  Delete
 Leisure & Tourism  success-stories/industry/leisure-tourism/   Delete
 Retail & Ecommerce success-stories/industry/retail-ecommerce/  Delete
 Innovation success-stories/industry/innovation/

Location New sub-category success-stories/location/ Delete Battle success-stories/location/battle/ Delete Bexhill success-stories/location/bexhill/ Delete Bodiam success-stories/location/bodiam/ Delete Crowborough success-stories/location/crowborough/ Delete

Firstly, how to i output the full path. All i'm getting is "creative-digital" for example. and not "success-stories/industry/creative-digital" So, when the link to the category is clicked it doesnt work because the full path isnt there.

Also, is there a way to target these catgeories in the set? i.e. i just want to pull out all subcategories of "Industry"?

Thanks

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Paul,

Firstly, how to i output the full path

You can use catPath:

<perch:categories id="categories" set="success-stories">
<perch:category id="catPath" />
</perch:categories>

Also, is there a way to target these catgeories in the set? i.e. i just want to pull out all subcategories of "Industry"?

You can use the filter option:

perch_categories([
    'filter' => 'catPath',
    'match' => 'contains',
    'value' => 'success-stories/industry'
]);