Add sale, all, new, featured links to list navigation (v. 2.81)

Version 2.81 systems have a new navigation type - %CATEGORY_LIST% (/enc/navbar_lists.php) which allows you to display your category links in a nested, unordered list format (i.e.

  • link
). This format allows you to add your own custom drop down menus, or otherwise style your links via CSS.

However, this link method does not allow you to view links to sale items, all items, new items or feature items within the unordered list. This will be added in the next release. For now, you can apply the following changes to add these links, to show these links. Please note: this modification will only show text; it will not show images for new, sale, featured or all product links:

  1. Open the stconfig.php file in the main public folder.

  2. Change the line:

    function setcategories($parent, $currentid, $currentparent, $indentval, $subindent, $surroundcode, 
    $navname, $catlevel, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly)

    to:

    function setcategories($parent, $currentid, $currentparent, $indentval, $subindent, $surroundcode, 
    $navname, $catlevel, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly, $extralinks='')
  3. Change the line:

    setcategories($catrow[ID], $currentid, $currentparent, $indentval, $subindent, $surroundcode, 
    $navname, $catlevel+1, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly);

    to:

    setcategories($catrow[ID], $currentid, $currentparent, $indentval, $subindent, $surroundcode, 
    $navname, $catlevel+1, $catisfirst, $baseclass, $showinactive, $showimages, $showmainonly, $extralinks);
  4. Change the lines:

    if ($cc == $catnum)
    echo "
    ";

    to:

    if ($cc == $catnum)
    {
    if($catlevel==0 AND !empty($extralinks))
    echo $extralinks;
    echo "
    ";
    }
  5. Open the navbar_lists.php file in the /enc/ folder.
  6. Remove the lines:

    setcategories($parentcat, $usecatval, 0, " ", "", "
  7. [%%INDENT%%][%%DISPLAY%%]", "listcat", 0, 0, "catcolor", "no", "yes", $showmnonly);
  8. Add the lines:

    // ADDITIONAL LINKS - NEW, FEATURED, SALES, ALL
    $add_additional_links = '';

    just above the line:

    // ADD NEW PRODUCT LINK
  9. Change the line:

    additionalLinks("new", $newnavimg, "New Items", "catcolor");

    to:

    $add_additional_links .= "
  10. New Items
  11. ";
  12. Change the line:

    additionalLinks("featured", $featurednavimg, "Featured Items", "catcolor");

    to:

    $add_additional_links .= "
  13. Featured Items
  14. ";
  15. Change the line:

    additionalLinks("sale", $salenavimg, "Sale Items", "catcolor");

    to:

    $add_additional_links .= "
  16. Sale Items
  17. ";
  18. Change the line:

    additionalLinks("all", $allnavimg, "All Items", "catcolor");

    to:

    $add_additional_links .= "
  19. All Items
  20. "; setcategories($parentcat, $usecatval, 0, " ", "", "
  21. [%%INDENT%%][%%DISPLAY%%]", "listcat", 0, 0, "catcolor", "no", "yes", $showmnonly, $add_additional_links);
  22. Save and reload all files.