Modular Merchant
QuickCode™ Glossary
QuickCode Tag Glossary Home
See also:
Knowledge Base
Articles in this category:




































{IF-CATEGORY-IS-ROOT-END} Updated: 02/13/2013

The {IF-CATEGORY-IS-ROOT-END} QuickCode Tag may be used in conjunction with the {IF-CATEGORY-IS-ROOT-BEGIN} QuickCode Tag to show or hide content selectively, depending on whether a category is a "root" category (meaning it is not a subcategory of any other category).

Requirements / Prerequisites

The {IF-CATEGORY-IS-ROOT-END} QuickCode Tag must be used in conjunction with the {IF-CATEGORY-IS-ROOT-END} QuickCode Tag.

The {IF-CATEGORY-IS-ROOT-BEGIN} {IF-CATEGORY-IS-ROOT-END} QuickCode Tag pair may be used in category.template.php, and may also be used between the {CATEGORY-BLOCK-BEGIN} and {CATEGORY-BLOCK-END} QuickCode Tags, in any templates that are compatible with {CATEGORY-BLOCK-BEGIN} and {CATEGORY-BLOCK-END}.

The {ELSE} and {NULL} QuickCode Tags are also compatible with the {IF-CATEGORY-IS-ROOT-BEGIN} {IF-CATEGORY-IS-ROOT-END} QuickCode Tag pair.

Example of Use

  For instance, to display a list of category names, with root categories in bold and subcategories in italics, the following code might be used:


The result would look like: 

Category 1
Subcategory 1-A
Subcategory 1-B
Category 2
Subcategory 2-A
Category 3
Subcategory 3-A
Subcategory 3-B


Alternatively, to create a category block that only displays the "root" categories in underlined text, and skips all subcategories, the following code might be used:


The result would look like:

Category 1
Category 2
Category 3

Source Code Source Code Updated:
When a web page using a template that contains this QuickCode Tag is viewed in the storefront, the {IF-CATEGORY-IS-ROOT-END} QuickCode Tag is changed into the source code below prior to the web page being displayed.
  Copyright © 2001 - 2024 Modular Merchant™. All rights reserved.
Modular Merchant | Privacy Policy | Legal Statement | Terms of Service | Contact Us | Site Map