shopp('collection.subcategory-list')

Displays a linked list of sub-categories of this category to be used for navigation.

Options

  • after: default is (empty). Adds content or markup to display after the category list markup.
  • before: default is (empty). Adds content or markup to display before the category list markup.
  • class: default is (empty). Used to specify CSS classes for the outer category list <ul> element. Has no effect when the wraplist option is disabled.
  • depth: Default is 0. Limits the number of levels of subcategories displayed in the subcategory list.
  • dropdown: Default is off. Specifies whether to display the list as a set of unordered list items <li> or as a set of drop-down menu options <select><option></select> Example: shopp('collection','subcategory-list','dropdown=on'); ?>
  • exclude: Default is (empty). Allows you to specify one (or more) category ids to skip in the subcategory list display.
  • hierarchy: Default is off. Displays the subcategory list showing subcategories indented provided that the active WordPress theme’s CSS doesn’t override
  • linkall: Default is off. When enabled, forces the category entry to be linked regardless of if there are no products assigned or no products with available inventory.
  • linkcount: Default is off. When enabled, forces the display for the number of products in the category to be included in the link rather than outside of the link.
  • order: Default is bestselling. Possible settings include: bestselling, highprice, lowprice, newest, oldest, random, and title
  • orderby: Default is name. Sort categories by category name, category id, category slug or the total count of products in the category.
  • products: Default is off. Displays the number of products in the subcategory in parentheses after the category name.
  • showall: Default is off. Forces display of subcategories in the list regardless of if they have no products assigned or no products with available inventory.
  • title: Default is (empty). Allows you to specify a title that is displayed before the menu
  • wraplist: Default is on. Automatically wraps the subcategory list items in a <ul> element when set to on. No outer <ul> is used when set to off.

Universal Options

All Theme API calls have these options.

  • return: when set to true, 1, or on, this option forces the tag to return the value instead of displaying/echoing the value to the page. Alternatively, prefix the tag parameter with get to get the same effect. All theme api tags that return a boolean value will return by default.
  • echo: when set to false, 0, or off, this option forces the tag to display the value to the page. This is the default for all non-boolean tags.
  • is: when set to true, 1, or on, this option will evaluate the return of the theme api call as a boolean true or false value. See how values are converted to boolean.

Examples

<?php shopp('collection','subcategory-list'); ?>

Sub-category List for a Specific Parent Category

Renders a list (menu) of sub-categories of a parent category

<?php
    shopp('catalog','collection','id=1&load=true');
    shopp('collection','subcategory-list');
?>

Sub-category Dropdown Menu for a Specific Parent Category

Renders a list (menu) of sub-categories of a parent category

<?php
    // Load category collection for custom layout
    shopp('catalog','collection','id=22&load=true');
    // Add the subcategory navigation as a dropdown menu
    shopp('collection','subcategory-list','dropdown=on&hierarchy=on');
?>

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar