coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: michaelpb on November 15, 2011, 01:17:09 PM

Title: parent category and subcategory
Post by: michaelpb on November 15, 2011, 01:17:09 PM
i want a way where i could use catrow_noalb only for categories with no parent categories and catrow_noalb2 for all other categories how can i do this?

Top Level parent category  | catrow_noalb
> sub category   | catrow_noalb2
>> sub category | catrow_noalb2
Title: Re: parent category and subcategory
Post by: ΑndrĂ© on November 15, 2011, 03:37:52 PM
Copy the function theme_display_cat_list from themes/sample/theme.php to your theme's theme.php if it doesn't exist. Then, find
    $template_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
and replace with
    global $cat;
    if ($cat) {
        $template_noalb = template_extract_block($template_cat_list, 'catrow_noalb2');
    } else {
        $template_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
    }
Title: Re: parent category and subcategory
Post by: michaelpb on November 15, 2011, 04:24:43 PM
is there anyway to get this to also work on the index page
Title: Re: parent category and subcategory
Post by: ΑndrĂ© on November 15, 2011, 05:20:48 PM
Wasn't that your initial question, as you can see categories without parents just on the index page?