Announcement

Collapse
No announcement yet.

Sub-Category images

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

    Sub-Category images

    In the Miva Admin, where do I define which picture would populate when using this -
    &mvte:global:subcatImage;
    *Edit:
    The code I am currently using is this:
    HTML Code:
    <mvt:if expr="subcatImage">   <img src="&mvte:global:subcatImage;" alt="&mvte:sub_category:name;" title="&mvte:sub_category:name;" /><mvt:else>   <img src="../images/img_no_thumb.jpg" alt="&mvte:sub_category:name;" title="&mvte:sub_category:name;" /></mvt:if>
    So the image that is showing on the site is the img_no_thumb.jpg

    Does this mean that I need to make an image type named subcatImage?

    Thanks much,
    MDurkee
    Last edited by mdurkee; 01-08-14, 03:52 PM.
    Maxanne Durkee
    Heavyweight Collections - Premium Heavy T-Shirts
    Facebook, Twitter, Blog

    #2
    Re: Sub-Category images

    There is no native variable for subcatImage. You may be using toolkit to look though sub categories and then the catImage function to pull the category title image?

    Code:
    <mvt:item name="toolkit" param="catimage|bigimage|l.all_settings:parent_category:code" />
    Is subcatImage defined in your code anywhere?
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Sub-Category images

      Originally posted by Brennan View Post

      Is subcatImage defined in your code anywhere?
      No, I don't believe subcatImage is defined anywhere, that was the original question, where would I define it? I don't want to add an image to my catTree, just want to pull a single image to use for each sub-category at the first row of the parent category page.
      Thanks
      Maxanne Durkee
      Heavyweight Collections - Premium Heavy T-Shirts
      Facebook, Twitter, Blog

      Comment


        #4
        Re: Sub-Category images

        Wouldn't you use the Category Image field and &mvt:category_title:image; in the template for this? (Note: Still trying to cut down on caffeine.)
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          Re: Sub-Category images

          Originally posted by Bruce - PhosphorMedia View Post
          Wouldn't you use the Category Image field and &mvt:category_title:image; in the template for this?
          Yes, I think that is the ticket but I am just using a framework that was created by someone else so have to look around to see how I can use &mvt:category_title:image; without it populating in my category tree.
          I think maybe I could make a custom field for the category and just call that??? Maybe it is me that needs to add a little caffeine to my diet. -Ha! :)
          Maxanne Durkee
          Heavyweight Collections - Premium Heavy T-Shirts
          Facebook, Twitter, Blog

          Comment


            #6
            Re: Sub-Category images

            Category Title image is different from the Category Tree Image...so it shouldn't show up in the Cat Tree. Long time ago (we use our own framework so not sure if its still there) by default, a category would display the Name OR the Image at the top of the category page template. But, you should be able to just add the image into the category (in the Edit Category admin screen) then use &mvt:category_title:image;
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


              #7
              Re: Sub-Category images

              OH! The smallest things trip me up somehow. The toolkit param code that was in there by default had
              HTML Code:
              <mvt:item name="toolkit" param="cattreeimage|subcatImage|l.all_settings:sub_category:code" />
              instead of catimage so I just kept overlooking and/or getting confused by that - kind of made it one in the same.
              Thanks so much Bruce for helping clear it up.

              Back to the caffeine
              MD
              Maxanne Durkee
              Heavyweight Collections - Premium Heavy T-Shirts
              Facebook, Twitter, Blog

              Comment


                #8
                Re: Sub-Category images

                I have been trying to do this, but ended up making images with the subcategory codes.jpg. Can you share the code that you ended up with ? I would rather use that, so I can upload the images into Miva directly. Are you loading them into the Category Title or into a custom field?

                Comment


                  #9
                  Re: Sub-Category images

                  Originally posted by anne226 View Post
                  Can you share the code that you ended up with ?
                  Here is the code I used:
                  HTML Code:
                  <div id="subcategory-listing">    
                  <mvt:foreach iterator="sub_category" array="sub_categories">        
                  <mvt:item name="toolkit" param="catimage|subcatImage|l.all_settings:sub_category:code" />        
                  <mvt:if expr="(pos1 MOD 4) EQ 1">            
                  <div class="product-wrapper first">        
                  <mvt:else>            
                  <div class="product-wrapper">        
                  </mvt:if>            
                  <a href="/category/&mvta:sub_category:code;.html" title="&mvte:sub_category:name;">               
                  <mvt:if expr="subcatImage">                
                  <img src="&mvte:global:subcatImage;" alt="&mvte:sub_category:name;" title="&mvte:sub_category:name;" />               
                  <mvt:else>                
                  <img src="../images/img_no_thumb.jpg" alt="&mvte:sub_category:name;" title="&mvte:sub_category:name;" />               
                  </mvt:if>            
                  </a>            
                  <span class="product-wrapper-name">&mvte:sub_category:name;</span>            
                  <a href="/category/&mvta:sub_category:code;.html" title="Get Details" class="button">Get Details</a>        
                  </div>    
                  </mvt:foreach>
                  </div>
                  I added the image that I wanted to use in the category title tab for each sub-category. I think I will need to make a custom field in order to bring in a description or some enticing text.
                  Last edited by mdurkee; 01-14-14, 09:14 AM.
                  Maxanne Durkee
                  Heavyweight Collections - Premium Heavy T-Shirts
                  Facebook, Twitter, Blog

                  Comment


                    #10
                    Re: Sub-Category images

                    You could use the categories header or footer for a descriptive text area...would be easier to enter information in and will hold more text.
                    Bruce Golub
                    Phosphor Media - "Your Success is our Business"

                    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                    phosphormedia.com

                    Comment


                      #11
                      Re: Sub-Category images

                      Thanks a LOT for your help.

                      Comment


                        #12
                        Re: Sub-Category images

                        So Bruce,
                        I can see how to pull the category header onto the page but am not sure how to get the sub-category header there. Could you give me a little more help there?
                        Maxanne
                        Maxanne Durkee
                        Heavyweight Collections - Premium Heavy T-Shirts
                        Facebook, Twitter, Blog

                        Comment


                          #13
                          Re: Sub-Category images

                          While you are looping through the subcats, you'll need to call that category's (which is now the sub-cat) header/footer. Since you are making the array with toolkit you'll have to see if there is away to call it from toolkit and then do something similar to the subcat image. (as i said, we use our own scripts to create the arrays needed so not very familiar with toolkit...sorry)
                          Bruce Golub
                          Phosphor Media - "Your Success is our Business"

                          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                          phosphormedia.com

                          Comment


                            #14
                            Re: Sub-Category images

                            Got it - - I found what I need in a thread labeled "Display Sub Category Header in the parent category page" to pull it in with toolkit. Thanks to all for the help.
                            Maxanne Durkee
                            Heavyweight Collections - Premium Heavy T-Shirts
                            Facebook, Twitter, Blog

                            Comment


                              #15
                              Re: Sub-Category images

                              Originally posted by mdurkee View Post
                              Got it - - I found what I need in a thread labeled "Display Sub Category Header in the parent category page" to pull it in with toolkit. Thanks to all for the help.
                              Hi can you post the final code you came up with for this?
                              I've been looking for something exactly like this to display the subcat images and subcat links in a table format.
                              That would be much appreciated and very helpful.

                              Thanks!

                              Comment

                              Working...
                              X