Announcement

Collapse
No announcement yet.

Parent Category Conditional

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Parent Category Conditional

    I am trying to setup a conditional for subnavigation to appear based on whether the current category code is 'xxx' or its parent category code is 'xxx'.

    I have the following on the CTGY template:

    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( 'category_code', l.settings:current_category )" />
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_ID( l.settings:current_category:parent_id, l.settings:parent_category )" />

    I can't seem to figure out how to call up the parent category from this: mvt:parent_category doesn't work.

    My conditional should work something like this:

    <mvt:if expr="tolower(g.category_code) EQ 'xxx' OR (g.parent_category_ID) EQ 'xxx'">
    </mvt:if>

    Not sure what I am missing.

    #2
    you did not assign g.category_code and g.parent_category_ID for condition to work

    also OR (g.parent_category_ID) should be OR tolower(g.parent_category_ID) i believe

    Comment


      #3
      Thanks for that suggestion. I played around with this some more with no luck. I did find a toolkit solution but this should be possible without toolkit using mvt:do correct?

      <mvt:item name="toolkit" param="childof|parentfound|g.Category_Code" />

      <mvt:if expr="l.settings:childof:code EQ 'xxx'">

      </mvt:if>

      Comment

      Working...
      X