Forum
Runway category loop
Does anyone know if there a way of looping through specific categories in Runway?
For example, I've created the following categories in 'Set A':
Category A
Sub Cat 1 of A
Sub Cat 2 of A
Category B
Category C
perch_categories();
will obviously loop through ALL categories in a nice nested list. Is there a way of only displaying/selecting level 1 categories - so return Category A, B and C, but exclude Sub Cats of A?
You may be able to test
catParentID
- it should be0
if it's a top level cat.Works perfectly. That's great, thanks.
Can I use the same approach for showing only Sub Cats? So, if I was on Category A page, only loop through Sub Cats of A, excluding Category B and C?
You should be able to match the path. Set the path of the parent you want to select from the page:
Then in your template:
Excellent, thanks.