Announcement

Collapse
No announcement yet.

Shadows v1 - styling the cat tree

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

    Shadows v1 - styling the cat tree

    I need to figure out how to style the cat tree to highlight the Parent, Child and Grandchild category

    On the left is the desired results. On the right is what the current results are.

    7a0g6Q.png7avTQC.png



    The "default" cattree code is currently being used:

    Code:
    <nav class="x-category-tree">
    <input id="categoryTree" class="x-category-tree__trigger" type="checkbox">
    <label class="x-category-tree__label u-text-uppercase" for="categoryTree">Categories</label>
    
    <ul class="x-category-tree__row">
    <mvt:foreach array="cattree_categories" iterator="cattree_category">
    <li class="x-category-tree__list x-category-tree__list--level-&mvte:cattree_category:level;">
    <mvt:if expr="NOT ISNULL l.settings:category:id AND l.settings:category:id EQ l.settings:cattree_category:id AND l.settings:page:code NE 'CTLG'">
    <a class="x-category-tree__link x-category-tree__link--current" href="&mvte:cattree_category:link;" title="&mvte:cattree_category:name;">&mvte:cattree _category:name;</a>
    <mvt:elseif expr="NOT ISNULL g.Category_Code AND ISNULL l.settings:category:id AND l.settings:cattree_category:code EQ g.Category_Code AND l.settings:page:code NE 'CTLG'">
    <a class="x-category-tree__link x-category-tree__link--current" href="&mvte:cattree_category:link;" title="&mvte:cattree_category:name;">&mvte:cattree _category:name;</a>
    <mvt:else>
    <a class="x-category-tree__link" href="&mvte:cattree_category:link;" title="&mvte:cattree_category:name;">&mvte:cattree _category:name;</a>
    </mvt:if>
    </li>
    </mvt:foreach>
    </ul>
    </nav>
    <!-- end .x-category-tree -->
    It would seem that this class is needed .x-category-tree__link--current - if someone has a solution would you mind sharing or feel free to reach out to me. Thanks!
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    Hi Leslie,

    You'll probably need to add in a couple MVT:DO statements to find the parent and grandparent categories of the current category. Then, either modify or create additional conditionals to add the current class to them as well.
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Leslie,

      Did you figue out a working fix to this? I am trying to do something similar, but I want to hide evrything but the parent and grandparent of the current category.

      Comment

      Working...
      X