First category is not highlighted (v. 2.95)

In category navigation on a web site, when a category is chosen, it's highlighted (bolded for most navigations, or uses active navigation colors for tab, button and bar navigation). However, this does not occur on the very first category; that category is not highlighted properly when selected.

To fix this, open the stconfig.php file, and find the following line (in the setcategories function, around line 831:

if ($catlevel == 0 AND $cc == 1 AND $navname == "vertcat")
	$newsurroundcode = str_replace(array("
", "
"), "", $surroundcode); elseif ($is_ul == 'y' AND !empty($currentid) AND $currentid == $catrow[ID]) $newsurroundcode = str_replace("
  • ", "
  • ", $surroundcode); else $newsurroundcode = $surroundcode;
  • and change it to:

    if ($catlevel == 0 AND $cc == 1 AND $navname == "vertcat")
    	$newsurroundcode = str_replace(array("
    ", "
    "), "", $surroundcode); else $newsurroundcode = $surroundcode; if ($is_ul == 'y' AND !empty($currentid) AND $currentid == $catrow[ID]) $newsurroundcode = str_replace("
  • ", "
  • ", $newsurroundcode);
  • Save and reload the file.

    Note: this fix may work in earlier versions, but has not been tested in those releases.