different number of categories depending on page different number of categories depending on page
 

News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

different number of categories depending on page

Started by macmiller, August 13, 2011, 04:36:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

macmiller

There is a config item: Number of levels of categories to display which indicates the depth of categories to display.  I would like to modify the behavior slightly, on the initial 'front page' index.php I would like to have one level of categories displayed and on other 'drill down' pages a different level.  (ie. on index.php say the level is 1 and in index.php?cat=xx say the level is 4).

Is there a way to tell from within the script index.php whether or not we are on the front page (index.php) or on another page?  Any suggestions on the easiest way to accomplish this mod?

ΑndrĂ©

Open index.php, find
if ($superCage->get->keyExists('cat')) {
    $cat = $superCage->get->getInt('cat');
}

and below, add
$CONFIG['subcat_level'] = $cat ? 4 : 1;

macmiller