Warning: simplexml_load_string(): Entity: line 1: parser error : Space required after the Public Identifier in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): ^ in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): Entity: line 1: parser error : SystemLiteral " or ' expected in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): ^ in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): Entity: line 1: parser error : SYSTEM or PUBLIC, the URI is missing in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): ^ in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: hr line 7 and body in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): ^ in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: body line 4 and html in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag html line 2 in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 341 QC: {IF-CATEGORY-IS-ROOT-END}
Modular Merchant
QuickCode™ Glossary
{IF-CATEGORY-IS-ROOT-END}
QuickCode Tag Glossary Home
See also:
Knowledge Base
Articles in this category:


{CATEGORIES-BULLETED-LIST}

{CATEGORY-ACTIVE}

{CATEGORY-ATTRIBUTE-DESCRIPTION}

{CATEGORY-ATTRIBUTE-TITLE}

{CATEGORY-ATTRIBUTE-VALUE}

{CATEGORY-BLOCK-BEGIN}

{CATEGORY-BLOCK-END}

{CATEGORY-BREADCRUMB-LINKS}

{CATEGORY-DESCRIPTION}

{CATEGORY-DISPLAY-ORDER}

{CATEGORY-HOMEPAGE}

{CATEGORY-IMAGE-TAG}

{CATEGORY-IMAGE-URL}

{CATEGORY-NAME}

{CATEGORY-NUMBER-OF-PRODUCTS}

{CATEGORY-NUMBER-OF-SUBCATEGORIES}

{CATEGORY-PARENT-CATEGORY-NAME}

{CATEGORY-PARENT-CATEGORY-SID}

{CATEGORY-RESULTS-BLOCK-BEGIN}

{CATEGORY-RESULTS-BLOCK-END}

{CATEGORY-SID}

{CATEGORY-TEMPLATE}

{CATEGORY-URL}

{IF-CATEGORY-ATTRIBUTE-BEGIN}

{IF-CATEGORY-ATTRIBUTE-END}

{IF-CATEGORY-IMAGE-BEGIN}

{IF-CATEGORY-IMAGE-END}

{IF-CATEGORY-IS-ROOT-BEGIN}

{IF-CATEGORY-IS-ROOT-END}

{PAGINATION}

{SHIPPING-OPTION-NAME}

{SUBCATEGORY-BEGIN}

{SUBCATEGORY-BLOCK-BEGIN}

{SUBCATEGORY-BLOCK-END}

{SUBCATEGORY-END}

Categories > {IF-CATEGORY-IS-ROOT-END}
<< {IF-CATEGORY-IS-ROOT-BEGIN} {PAGINATION} >>
{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:

{CATEGORY-BLOCK-BEGIN} 
{IF-CATEGORY-IS-ROOT-BEGIN}{CATEGORY-NAME}{ELSE}{CATEGORY-NAME}{IF-CATEGORY-IS-ROOT-END} 
{CATEGORY-BLOCK-END}

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:

{CATEGORY-BLOCK-BEGIN} 
{IF-CATEGORY-IS-ROOT-BEGIN}{CATEGORY-NAME}{ELSE}{NULL}{IF-CATEGORY-IS-ROOT-END} 
{CATEGORY-BLOCK-END}

The result would look like:

Category 1
Category 2
Category 3

Source Code Source Code Updated: Warning: date() expects parameter 2 to be long, string given in /var/www/vhosts/qc.modularmerchant.com/httpdocs/article.php on line 796
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.
LOG IN TO ADD COMMENTS
  Copyright © 2001 - 2019 Modular Merchant™. All rights reserved.
Modular Merchant | Privacy Policy | Legal Statement | Terms of Service | Contact Us | Site Map