Announcement

Collapse
No announcement yet.

Subcategory Display

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

    Subcategory Display

    I think I am missing something very simple. We have started a new store on Colossus and I am used to making Parent and Children categories, and when I land on the Parent CTGY page, it would show the children below. I see the children in the Slick header, but child categories don't display on the main page. If I turn on products for the parent, those show in the space where I would expect the child categories. What did I miss? I cannot seem to find this in the docs.

    Also - I made an exact copy of CTGY to CTGY_CSTM so we could change a few things, and when I do this, I lose the Slick nav bar. I have looked in Global Header and Footer and a few other page files but cannot find the references to slick. Where do I have to add the page code CTGY_CSTM so it will also display the slick nav at top of a Category?

    Thanks!!
    Attached Files

    #2
    In Colossus, the subcategories only show at the top of the page like you are seeing. As for the copy, you will have to add a new page function to your theme.js file. The easiest way would be to duplicate the jsCTLG function and name it jsCTGY_CSTM.
    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
      Ah okay. I thought it might be something like that.. so we will play with the slick nav and move it around to fit our needs. Thanks a bunch Matt Zimmermann

      Comment


        #4
        Just curious -- where do I edit the slick nav location and/or hide it? I cannot seem to find the "o-wrapper t-wrapper t-subcategory-navigation slick-initialized slick-slider" code in the normal locations. Like if I want to move that to the footer, or somewhere else, I cannot seem to find where to call it from.

        Comment


          #5
          The code is located in the CTGY page template:
          Code:
              <mvt:foreach array="cattree_categories" iterator="category_children">
                  <mvt:if expr="l.settings:category_children:parent_id EQ l.settings:category:id">
                      <mvt:assign name="l.null" value="miva_array_insert(l.settings:subcategories, l.settings:category_children, -1)" />
                  </mvt:if>
              </mvt:foreach>
              <mvt:assign name="l.settings:subcategory_count" value="miva_array_elements(l.settings:subcategories)" />
          
              <mvt:if expr="l.settings:subcategories GT 0">
                  <section class="u-bg-white t-expanded-block t-subcategory-navigation-block" data-hook="subcategory-navigation-block">
                      <nav class="o-wrapper t-wrapper t-subcategory-navigation" data-hook="subcategory-navigation-slider"></nav>
                  </section>
                  <template data-hook="subcategory-navigation">
                      <mvt:foreach iterator="subcategory" array="subcategories">
                          <div class="u-text-center t-subcategory-navigation__item">
                              <a class="u-block u-color-black t-subcategory-navigation__link" href="&mvte:subcategory:link;">
                                  <figure class="t-subcategory-navigation__figure">
                                      <mvt:if expr="l.settings:subcategory:image">
                                          <!-- Image: 240x315 -->
                                          <picture class="t-subcategory-navigation__picture">
                                              <img class="t-subcategory-navigation__image" data-lazy="&mvte:subcategory:image;" src="" alt="&mvte:subcategory:name;">
                                          </picture>
                                      </mvt:if>
                                      <figcaption class="t-subcategory-navigation__figure-caption">
                                          <span class="t-subcategory-navigation__name">&mvte:subcategory:name;</span>
                                      </figcaption>
                                  </figure>
                              </a>
                          </div>
                      </mvt:foreach>
                  </template>
              </mvt:if>
          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


            #6
            I kept searching for a keyword of Slick assuming it would be in there like in elements in Google! Thanks again!!

            Comment


              #7
              How does slick sort subcategories by default? I figured it would follow the sort order in Miva, but that doesn't appear to be true.

              Comment


                #8
                I believe it is how they were added to the admin.
                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


                  #9
                  That makes sense after testing by deleting and manually creating new ones. Problem is I did a bunch via import and they do not match the file or Miva backend when it comes to sorting. Just weird that the imported categories don't match.

                  Comment


                    #10
                    I think it's columns vs rows that is throwing the sort off.. looking into it now.

                    Comment

                    Working...
                    X