Miva Merchant Development by Scot's Scripts

CATEGORY: How to Detect Category Header/Footer Contents

Miva Knowledge Base
CATEGORY: How to Detect Category Header/Footer Contents

WARNING:

This information is offered "AS IS" for internal reference only. Use at your own risk.
Does AI actually understand your Miva Merchant store? Our smart JSON-LD schema generator makes sure it does. Contact us to get started. (more info)

CATEGORY: How to Detect Category Header/Footer Contents

Bruce Golub • February 06, 2024 (updated: February 06, 2024)


THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED;
THE AUTHOR DISCLAIMS ALL LIABILITY FOR ANY DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR STORE DISRUPTIONS ARISING FROM ITS USE.


Because category headers and footers are rendered via an SMT Item, there isn't a variable to detect before that item is rendered. So, the solution is thus:

<mvt:capture variable="g.has_header">
<mvt:item name="prod_ctgy_hdft" param="ctgy_header" />
</mvt:capture>

Now you have a variable you can use:

<mvt:if expr="g.has_header"> do something </mvt:if>

Obviously, this can be used for any SMT item that renders content.


https://www.scotsscripts.com/mvblog/how-to-detect-category-headerfooter-contents.html

mvkb_categories mvkb_smt