Notice: Undefined variable: out in /path/fromthemtous/perch/core/lib/PerchUtil.class.php on line 83
Notice: Undefined variable: Template in /path/fromthemtous/perch/core/lib/PerchFactory.class.php on line 620
Fatal error: Call to a member function find_all_tag_ids() on a non-object in /path/fromthemtous/perch/core/lib/PerchFactory.class.php on line 620
Now, I'd like to pull only the array of categories assigned to a particular item, in the context of a list / detail page. I'm doing something ugly for now:
// Getting the results
$getThemes = perch_content_custom('Episodes', array(
'skip-template' => true,
'filter' => 'slug',
'match' => 'eq',
'value' => perch_get('s'),
'count' => 1
));
// Counting the number of array entries
$numThemes = count($getThemes[0]['themes']);
for($i=0; $i<$numThemes;$i++) {
$currentTheme = $getThemes[0]['themes'][$i];
// Setting the category path to perch_category
$themes = perch_category($currentTheme, array(
'skip-template' => true
));
print_r($themes);
}
I believe there's a much cleaner way to do with Perch but I can't get it to filter the results for the particular slug. Something like. Could you help with the filtering part?
If the page is white then PHP is throwing an error. Look at your PHP error log to see what the error is.
Here's the error:
Ah, ok. That's been fixed already and so should be in today's release. Sorry for the trouble.
Great, thanks for the info!
Thanks for the fix. I get the list of categories for a particular set with:
Now, I'd like to pull only the array of categories assigned to a particular item, in the context of a list / detail page. I'm doing something ugly for now:
I believe there's a much cleaner way to do with Perch but I can't get it to filter the results for the particular slug. Something like. Could you help with the filtering part?
Sorry for bothering with this post, it's going on for a long time:) almost there!
Cheers,
That's not ugly - it's perfectly fine. Use
skip-template
to get the item and you'll get an array of the assigned categories. That's how it works.