Skip to content

Instantly share code, notes, and snippets.

@chrisboulton
Created February 15, 2010 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisboulton/304539 to your computer and use it in GitHub Desktop.
Save chrisboulton/304539 to your computer and use it in GitHub Desktop.
<?php
// includes/classes/class.category.php. Add before:
// $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle($this->BuildTitle());
$bodyClasses = '';
$parents = explode(',', $this->Data['catparentlist']);
foreach($parents as $parent) {
if(!trim($parent)) {
continue;
}
$bodyClasses .= ' category'.$parent;
}
$GLOBALS['ISC_CLASS_TEMPLATE']->assign('BodyClasses', $bodyClasses);
// In template/category.html, class="%%GLOBAL_BodyClasses%%"
// Will give you, for ex: class="category1 category3 category4" (assuming current category is 1 > 3 > 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment