Display subcat images with links on parent cat page using toolkit... not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rcm1234
    Mini Mivite

    • Oct 2011
    • 71

    #1

    Display subcat images with links on parent cat page using toolkit... not working

    Hi,

    I'm trying to display the sub category title image and a text link to the subcats on the parent category page.

    Does someone have a 100% working version of this that they can share the code with me please?

    *Someone posted this code to do that previously but it does not work at all when I try to use it -->


    <div id="subcategory-listing">
    <mvt:foreach iterator="sub_category" array="sub_categories">
    <mvt:item name="toolkit" param="catimage|subcatImage|l.all_settings:sub_cat egory: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>
    </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>


    Any help would be greatly appreciated.
    Thanks in advance.
    Last edited by rcm1234; 09-05-14, 12:32 PM.
  • Mark Hood
    Mega Mivite








    • Nov 2006
    • 2560

    #2
    Re: Display subcat images with links on parent cat page using toolkit... not working

    Originally posted by rcm1234 View Post
    Hi,

    I'm trying to display the sub category title image and a text link to the subcats on the parent category page.

    Does someone have a 100% working version of this that they can share the code with me please?

    *Someone posted this code to do that previously but it does not work at all when I try to use it -->


    <div id="subcategory-listing">
    <mvt:foreach iterator="sub_category" array="sub_categories">
    <mvt:item name="toolkit" param="catimage|subcatImage|l.all_settings:sub_cat egory: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>
    </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>


    Any help would be greatly appreciated.
    Thanks in advance.
    Code looks correct minus the spaces but they me be the way it posted in the forum. Toolkit up to date and assigned to the ctgy page? Does anything show up?

    make sure there is no space in your code like it was posted l.all_settings:sub_cat egory:code
    Last edited by Mark Hood; 09-05-14, 12:42 PM.
    Mark Hood
    Vermont Gear

    Comment

    • rcm1234
      Mini Mivite

      • Oct 2011
      • 71

      #3
      Re: Display subcat images with links on parent cat page using toolkit... not working

      Originally posted by Mark Hood View Post
      Code looks correct minus the spaces but they me be the way it posted in the forum. Toolkit up to date and assigned to the ctgy page? Does anything show up?

      make sure there is no space in your code like it was posted l.all_settings:sub_cat egory:code
      Hi... thanks for the reply and trying to help out with this.
      I just double checked my code and it has no spaces... and toolkit is definitely assigned to the CTGY page.

      Still nothing at all shows up on the parent cat page as desired... i.e. no subcat link, photo etc... nothing.
      I'm using the Miva Bootstrap Framework to build this site... would that be an issue with this?

      I have the Category title images in their proper place as well... these are the photos I want to show up on the parent cat page... i.e. like a landing page that shows a thumbnail image and text link underneath of the subcat names that are clickable.

      Not sure why this isn't working...

      Comment

      • rcm1234
        Mini Mivite

        • Oct 2011
        • 71

        #4
        Re: Display subcat images with links on parent cat page using toolkit... not working

        Originally posted by rcm1234 View Post
        Hi... thanks for the reply and trying to help out with this.
        I just double checked my code and it has no spaces... and toolkit is definitely assigned to the CTGY page.

        Still nothing at all shows up on the parent cat page as desired... i.e. no subcat link, photo etc... nothing.
        I'm using the Miva Bootstrap Framework to build this site... would that be an issue with this?

        I have the Category title images in their proper place as well... these are the photos I want to show up on the parent cat page... i.e. like a landing page that shows a thumbnail image and text link underneath of the subcat names that are clickable.

        Not sure why this isn't working...
        As an experiment I tried it using the simpler code Emporium Plus offers in the Toolkit docs.... and this works when substituted for the code I posted above -->

        <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />
        <mvt:if expr="ccount GT 0">
        <mvt:foreach iterator="sub_category" array="sub_categories">
        &mvt:sub_category:name;
        </mvt:foreach>
        </mvt:if>


        Any ideas?
        thanks again.
        Last edited by rcm1234; 09-05-14, 02:25 PM.

        Comment

        • Mark Hood
          Mega Mivite








          • Nov 2006
          • 2560

          #5
          Re: Display subcat images with links on parent cat page using toolkit... not working

          Originally posted by rcm1234 View Post
          As an experiment I tried it using the simpler code Emporium Plus offers in the Toolkit docs.... and this works when substituted for the code I posted above -->

          <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />
          <mvt:if expr="ccount GT 0">
          <mvt:foreach iterator="sub_category" array="sub_categories">
          &mvt:sub_category:name;
          </mvt:foreach>
          </mvt:if>


          Any ideas?
          thanks again.
          Try
          Code:
          <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />
          <div class="row">    <mvt:foreach iterator="sub_category" array="sub_categories">
                  <mvt:item name="toolkit" param="cattreeimage|subcatImage|l.all_settings:sub_category:code" />
          <div class="col-md-3 col-sm-4 col-xs-6">
          <div class="subcategory-item">
                  <div class="item-image">
                      <a href="../&mvta:sub_category:code;.html" title="&mvte:sub_category:name;"><mvt:if expr="subcatImage"><img src="http://www.yourdomain.com/mm5/&mvte:global:subcatImage;" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" class="img-responsive"/><mvt:else><img src="/mm5/images/img_no_thumb.jpg" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" class="img-responsive" /></mvt:if></a>
                  </div>
          <div class="clearfix"></div>
          <div class="center"><h5><a href="../&mvta:sub_category:code;.html">&mvt:sub_category:name;</a></h5></div>
                      
                  </div></div>
              </mvt:foreach>
          </div>
          Last edited by Mark Hood; 09-06-14, 09:19 AM.
          Mark Hood
          Vermont Gear

          Comment

          • Mark Hood
            Mega Mivite








            • Nov 2006
            • 2560

            #6
            Re: Display subcat images with links on parent cat page using toolkit... not working

            I think you had this missing...which may make the difference.
            <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />

            That new code should work well with bootstrap since it's what we use. You may just need to take a look at the css involved and change to your link style
            Last edited by Mark Hood; 09-05-14, 03:36 PM.
            Mark Hood
            Vermont Gear

            Comment

            • rcm1234
              Mini Mivite

              • Oct 2011
              • 71

              #7
              Re: Display subcat images with links on parent cat page using toolkit... not working

              Hi,

              Thanks... that works great.
              One thing though... that path to the subcat image is not pulling in the Category 'Title Image' like I need it to... it is showing a blank box/placeholder.

              Any idea how to edit the above image path to use only the Category 'Title Image' ?

              Also, is there some way to incorporate this into it so I can display the subcats horizontally in columns i can control (*I just want a simple 3 or 4 across setup) -->

              <mvt:if expr="(pos1 MOD 4) EQ 1">
              <div class="product-wrapper first">
              <mvt:else>
              <div class="product-wrapper">
              </mvt:if>


              Thanks again.


              Originally posted by Mark Hood View Post
              Try
              Code:
              <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />
              <div class="row">    <mvt:foreach iterator="sub_category" array="sub_categories">
                      <mvt:item name="toolkit" param="cattreeimage|subcatImage|l.all_settings:sub_category:code" />
              <div class="col-md-3 col-sm-4 col-xs-6">
              <div class="subcategory-item">
                      <div class="item-image">
                          <a href="../&mvta:sub_category:code;.html" title="&mvte:sub_category:name;"><mvt:if expr="subcatImage"><img src="http://www.yourdomain.com/mm5/&mvte:global:subcatImage;" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" class="img-responsive"/><mvt:else><img src="/mm5/images/img_no_thumb.jpg" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" class="img-responsive" /></mvt:if></a>
                      </div>
              <div class="clearfix"></div>
              <div class="center"><h5><a href="../&mvta:sub_category:code;.html">&mvt:sub_category:name;</a></h5></div>
                          
                      </div></div>
                  </mvt:foreach>
              </div>
              Last edited by rcm1234; 09-08-14, 10:52 AM.

              Comment

              • Mark Hood
                Mega Mivite








                • Nov 2006
                • 2560

                #8
                Re: Display subcat images with links on parent cat page using toolkit... not working

                You can probably go back to your original code and/or compare it making sure the first line is
                <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />

                Locking it into columns will defeat the purpose of bootstrap though. I'm sure you need to change the link structure to match your site and you can remove the else to show the blank image if none is available.
                Mark Hood
                Vermont Gear

                Comment

                Working...
                X