Announcement

Collapse
No announcement yet.

Subcat Thumbnails display

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

  • Subcat Thumbnails display

    I'm not sure if this is ReadyTheme specific or a new function added in the update to 9.6 but it's pretty darn cool. In the CTGY Content (subcategory_listing)

    Code:
    <mvt:comment><!-- Load First Product From Sub Category & It's resized Main image --></mvt:comment>
    I only have one problem - how do I get it to pull in an image for sub-sub cats? Or do I have to still do it the "old-fashioned" way?

    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

  • The loop running there will only go to the subcategory level. Without having to use additional MVT:DO function to pull the sub-subcategories and perform the image search, the old-fashioned way would probably be best. Of course, you can always assign a category tree image to the categories to use that instead.
    Matt Zimmermann
    Director of UI/UX Standards and Theme Development
    / Miva, Inc.

    Comment


    • I am really liking this new feature. Any chance of it being able to randomize the image it pulls in? Should I take this request to the wishlist?
      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

      Comment


      • Hi Leslie,
        Unfortunately, randomizing would/could be a detriment to page load speed as scanning through all products in a category, selecting a random one, and pulling its image is not a quick function. It should be possible, but we wouldn't recommend it.
        Matt Zimmermann
        Director of UI/UX Standards and Theme Development
        / Miva, Inc.

        Comment


        • Originally posted by Matt Zimmermann View Post
          The loop running there will only go to the subcategory level. Without having to use additional MVT:DO function to pull the sub-subcategories and perform the image search, the old-fashioned way would probably be best. Of course, you can always assign a category tree image to the categories to use that instead.
          Would you believe, that on a dev site I'm working it seems to be pulling from a sub-sub? At least for 4 of the 6. But now that I've moved the site live it stopped working. Was it a fluke that it worked in the dev environment? I may need to have you take a peek at it.

          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

          Comment


          • If the production and development stores are on the same engines and version, I don't see why it would not work the same.
            Matt Zimmermann
            Director of UI/UX Standards and Theme Development
            / Miva, Inc.

            Comment


            • Originally posted by Matt Zimmermann View Post
              If the production and development stores are on the same engines and version, I don't see why it would not work the same.
              That's my question too. The engine and Miva version are the same. The only thing I did different was to start with Iron & Wool ReadyTheme By Miva, Inc. Version 1.5.0 (Includes 9.0006 Template Changes) instead of Iron & Wool ReadyTheme By Miva, Inc. Version 1.4.0 (Includes 9.0005 Template Changes). Was there some subtle change that killed it?

              - I have a support ticket open
              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

              Comment


              • Nothing that I am aware of.
                Matt Zimmermann
                Director of UI/UX Standards and Theme Development
                / Miva, Inc.

                Comment


                • Originally posted by Matt Zimmermann View Post
                  Nothing that I am aware of.
                  Ticket #WVN-633-48971 - I had it working pretty well in the dev site (not so much anymore).
                  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

                  Comment


                  • It would seem that this little piece of awesome sauce is NOT from Iron & Wool but is from Levels (My extreme humble apologizes for insisting that it came from Iron & Wool). It does work well in Iron & Wool so you can use it in the CTGY > Content (subcategory_listing) field:

                    Code:
                    <mvt:if expr="l.settings:subcats GT 0">
                        <div class="row bg-white main-content-row sub-category-layout">
                            <mvt:foreach iterator="sub_category" array="subcats">
                                <mvt:comment><!-- Load First Product From Sub Category & It's resized Main image --></mvt:comment>
                                    <mvt:if expr="ISNULL l.settings:sub_category:image AND ISNULL l.settings:category:cf:category_hide_sub_category_images">
                                        <mvt:do file="g.Module_Library_DB" name="l.result" value="Runtime_ProductList_Load_Offset_Category( l.settings:sub_category:id, 1, 1, l.settings:sub_category:sub_products:next_offset, l.settings:sub_category:sub_products:list )" />
                                        <mvt:assign name="l.settings:sub_category:product" value="l.settings:sub_category:sub_products:list[1]" />
                                        <mvt:do file="g.Module_Library_DB" name="l.settings:sub_category:product:image_count" value="ProductImageDataList_Load_Product(l.settings:sub_category:product:id, l.settings:sub_category:product:images)" />
                                        <mvt:foreach iterator="image" array="sub_category:product:images">
                                            <mvt:if expr="l.settings:image:imagetype:code EQ 'main'">
                                                <mvt:assign name="l.settings:sub_category:product:main_image" value="l.settings:image" />
                                                <mvt:foreachstop/>
                                            </mvt:if>
                                        </mvt:foreach>
                                        <mvt:if expr="l.settings:sub_category:product:main_image:image:id">
                                            <mvt:do file="g.Module_Library_DB" name="l.result" value="GeneratedImage_FindOrInsert_Image_Dimensions( l.settings:sub_category:product:main_image:image, '300', '200', l.settings:sub_category:product:main_image:generated )" />
                                        </mvt:if>
                                        <mvt:if expr="l.settings:sub_category:product:main_image:generated:id">
                                            <mvt:assign name="l.settings:sub_category:image" value="l.settings:sub_category:product:main_image:generated:image" />
                                        </mvt:if>
                                    </mvt:if>
                    
                                <div class="column half medium-one-third sub-category uppercase">
                                    <a href="&mvt:sub_category:link;" title="&mvt:sub_category:name;">
                    
                                        <mvt:if expr="l.settings:sub_category:image AND ISNULL l.settings:category:cf:category_hide_sub_category_images">
                                            <img src="&mvt:sub_category:image;" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" />
                    
                                        </mvt:if>
                    
                    
                                        &mvt:sub_category:name;
                                    </a>
                                </div>
                            </mvt:foreach>
                        </div><!-- end sub-category listings -->
                    </mvt:if>
                    Leslie
                    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

                    Comment


                    • Wow, two years later and I need to come back to this. It seems that the thumbnail being pulled for this display is not the first product in the category but the second (and I swear I've asked this question before). How do I get the code to pull the first product image and not the second?

                      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

                      Comment


                      • Hi Leslie,

                        I'm not sure why the second product would be selected. Is it possible that the second product displayed for the subcategory is actually the first product as far as the administration portal is concerned?
                        Matt Zimmermann
                        Director of UI/UX Standards and Theme Development
                        / Miva, Inc.

                        Comment


                        • Originally posted by Matt Zimmermann View Post
                          Hi Leslie,

                          I'm not sure why the second product would be selected. Is it possible that the second product displayed for the subcategory is actually the first product as far as the administration portal is concerned?
                          Any product I put in the second position in the administrative portal (for the category that the products are assigned to) is what displays the thumbnail. I recall having this question before but I can't find the question or answer.
                          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

                          Comment


                          • Originally posted by lesliekirk View Post

                            Any product I put in the second position in the administrative portal (for the category that the products are assigned to) is what displays the thumbnail. I recall having this question before but I can't find the question or answer.
                            This is still a problem - is there a "fix" for it yet?
                            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

                            Comment


                            • Hi Leslie,

                              I'm not sure why you are seeing this. Maybe try changing the offset in the ProductList to 0 [ https://docs.miva.com/api-functions/...ffset_category ]
                              Matt Zimmermann
                              Director of UI/UX Standards and Theme Development
                              / Miva, Inc.

                              Comment

                              Working...
                              X

                              This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

                              This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

                              Accept