Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: parent category and subcategory  (Read 2599 times)

0 Members and 1 Guest are viewing this topic.

michaelpb

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
parent category and subcategory
« 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: parent category and subcategory
« Reply #1 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
Code: [Select]
    $template_noalb = template_extract_block($template_cat_list, 'catrow_noalb');and replace with
Code: [Select]
    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');
    }
Logged

michaelpb

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: parent category and subcategory
« Reply #2 on: November 15, 2011, 04:24:43 pm »

is there anyway to get this to also work on the index page
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: parent category and subcategory
« Reply #3 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?
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.