Forum
Filtering Categories by Blog Section
Is there a way to show a list of categories which have only been used on posts within a specified Blog section (not category set as I can only use Blog as the set).
Is there a way to show a list of categories which have only been used on posts within a specified Blog section (not category set as I can only use Blog as the set).
There isn't currently.
Ok thanks.
I'm trying to think of a way around it...
If I use categories with subcategories can I filter on the catSlug using the categories as a way of 'sectioning' the subcategories?
Does a subcategories category appear in the Slug? I don't think it does, so perhaps I've answered my own question
It doesn't have to appear in the slug - that's up to you, but you'll need to know how to piece together the category path if you don't have it in the slug.
Hi Drew,
Apologises for the delay, I'm just getting my head back into this project.
To create a list of categories with 'monkey' in the path would I do something like this?
Yes, I think so. Is that not working?
No it doesn't.
EDIT:
Actually sorry I may not have been very clear. I'm looking to sort by the Categories Path so say there are some categories like:
blog/animal/monkey
blog/animal/panda
I want to get all the categories with the 'animal' path, is that possible?
Neither of those examples have a slug that is equal to (
eq
) 'animal', which is why it's not matching.I think the type of match you want is
contains
.Is filtering by catSlug going to look at the Path?
To get all categories that contains 'animal' I'd do this?
I feel I could use Category templates to help me create a way of filtering what I want here but I'm having trouble using it. Whenever I try to change the Category Template or Set Template it just reverts back to Set for each
That's what I was suppose to paste into my previous post rather than repeating eq again.
That doesn't return anything.
Debug:
Is this your first category set?
Yes it's the blog one.
I would expect that to work. I'll try to have a look at it in the morning.
Thanks Drew.
The Set template and Category template is on 'Set' and I can't change it (it reverts back after saving). I'm not sure if that would have anything to do with it but thought it was worth a mention.
Are you using Perch 2.8.2?
Yes I am, but I think I had the category template problem before
Ok, we're looking into this.