Announcement

Collapse
No announcement yet.

Display specific category listing

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

    Display specific category listing

    I'm not sure if this can be done with the ReadyTheme or if I'll need to move this question to Store Morph. I would like to display a specific category's sub categories on the SFNT screen. After looking at the ReadyTheme's Navigation Sets - it doesn't look like it could dynamically pull in the specific category's sub-cats. In the past I've pulled in a specific category's products to the SFNT using Toolkit, I suppose I can tweak up something like that, but this would again be one of those Toolkit snippets that I would like to try and use native code for.

    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

    #2
    Re: Display specific category listing

    Hey Leslie -


    There is nothing in readythemes to allow you to do what you're looking for.


    However now that you can use mvt:do in the template language you can do something like this:


    Code:
    
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( 'category_code', l.settings:current_category )" />
    <mvt:do name="l.result" file="g.Module_Library_DB" value="CategoryList_Load_Parent( l.settings:current_category:id, l.settings:sub_categories )" />
    
    <mvt:foreach iterator="subcat" array="l.settings:sub_categories">
        &mvt:subcat:active;
        &mvt:subcat:agrpcount;
        &mvt:subcat:code;
        &mvt:subcat:disp_order;
        &mvt:subcat:id;
        &mvt:subcat:name;
        &mvt:subcat:parent_id;
    </mvt:foreach>
    Here are some other toolkit functions you can do in Miva using mvt:do

    http://www.miva.com/videos/articles/...ement-examples
    Last edited by Brennan; 05-04-15, 03:55 PM.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Display specific category listing

      Do I change category_code to the parent category code that I want to load the subcats of?
      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


        #4
        Re: Display specific category listing

        I'm thinking not - the code looks like it will only work on a CTGY page. I'm trying to display on the SFNT.
        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


          #5
          Re: Display specific category listing

          So this is the code that I'm working to tweak. It displays the subcats on the SFNT - the only product is it displays ALL of the 1st level subcats. I need to fine tune it to display the subcats of a specific parent cat.

          Code:
          <mvt:item name="toolkit" param="parentcat|pccount" /><!-- check for parent cats //-->
          <mvt:foreach iterator="parent_category" array="parent_categories">
          <!-- check for 1st level subcats //-->
          <mvt:item name="toolkit" param="subcat|ccount|l.all_settings:parent_category:code" />
          <mvt:if expr="ccount GT 0">
          <mvt:foreach iterator="sub_category" array="sub_categories">
          <mvt:if expr="g.Category_Code EQ l.settings:sub_category:code">
          &nbsp; &mvt:sub_category:name;<br>
          <mvt:else>
          &nbsp;<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=PE&Category_Code=&mvta:sub_category:code;">
          &mvt:sub_category:name;</a><br>
          </mvt:if>
          
          
          </mvt:foreach>
          </mvt:if>
          </mvt:foreach>
          I'll keep dinking around and when I get it, I'll post it for posterity.
          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


            #6
            Re: Display specific category listing

            Something like this should work:

            Code:
            <mvt:assign name="g.category_code" value="'my_cat_code'" />
            
            
            <mvt:item name="toolkit" param="subcat|ccount|g.category_code" />
            
            
            <mvt:if expr="ccount GT 0">
                <mvt:foreach iterator="sub_category" array="sub_categories">
            
                     <a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=PE&Category_Code=&mvta:sub_category:code;">
                        &mvt:sub_category:name;</a><br>
                     
                </mvt:foreach>
            </mvt:if>
            Last edited by Brennan; 05-05-15, 08:35 AM.
            Brennan Heyde
            VP Product
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment

            Working...
            X