Announcement

Collapse
No announcement yet.

Is there a way to display a related categories in CTGY page?

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

    Is there a way to display a related categories in CTGY page?

    Is there a way to display a related categories in CTGY page?
    Thank you, Bill Davis

    #2
    There's nothing built-in to the store specifically for this, like there is for related products. I would try getting creative with ReadyTheme Navigation Sets.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      How are the categories "related", for example, if they all have the same parent, you could use

      Code:
       <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.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="sub_categories">
       <mvt:if expr="l.settings:subcat:code NE g.category_code">
       &mvt:subcat:name;<br/>
       </mvt:if>
       </mvt:foreach>
      To show the name of all categories that have the same parent category as the current one.
      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


        #4
        Originally posted by Bruce - PhosphorMedia View Post
        How are the categories "related", for example, if they all have the same parent, you could use

        Code:
         <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.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="sub_categories">
        <mvt:if expr="l.settings:subcat:code NE g.category_code">
        &mvt:subcat:name;<br/>
        </mvt:if>
        </mvt:foreach>
        To show the name of all categories that have the same parent category as the current one.
        Sometime categories belong the same parent, but sometimes they are not.
        Thank you, Bill Davis

        Comment


          #5
          If you have only an 'ad hoc' relationship of categories, you might as well just create a custom field, and put the 'related' categories in there, then call that field and load the data you need for them...or literally put that HTML of the required display in that field.
          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


            #6
            Originally posted by Bruce - PhosphorMedia View Post
            If you have only an 'ad hoc' relationship of categories, you might as well just create a custom field, and put the 'related' categories in there, then call that field and load the data you need for them...or literally put that HTML of the required display in that field.
            We sometimes have "ad hoc" relationships of categories. Because there can be more than one categories with "ad hoc" relationship, could one create a custom drop-down list with multiple category selections in admin?
            Thank you, Bill Davis

            Comment


              #7
              There's no support for multi-select drop downs in the admin. you'd need to use a delineated text field like cat1,cat2,cat3 and use gettoken to look through those.
              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


                #8
                Bruce - PhosphorMedia

                Is the code you provided for related sub cats more efficient than the toolkit code we are using?

                Code:
                        <mvt:item name="toolkit" param="childof|parentfound|g.Category_Code" />
                        <mvt:item name="toolkit" param="vassign|Category_Code|l.all_settings:childof:code" /> 
                        <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />
                        <mvt:if expr="ccount GT 0">
                            <div class="column whole np category-tree mtp1-25 print-hide" style="margin-bottom: 2.5rem">
                                <input id="related-cats" type="checkbox" name="menu">
                                <label for="related-cats">Shop Related Categories</label>
                                <nav class="submenu">
                                    <div class="row bottom-shadow main-content-row o-layout u-grids-3 u-grids-4--xs u-grids-5--s u-grids-6--m sub-category-layout"  style="margin: 1rem 0 1.25rem 0">
                                        <mvt:foreach iterator="sub_category" array="sub_categories">
                                            <mvt:item name="toolkit" param="cattreeimage|subcatImage|l.all_settings:sub_category:code" />
                                            <mvt:if expr="l.settings:category:code EQ l.settings:sub_category:code">
                                                <div class="o-layout__item sub-category blue">
                                                    <div class="bold u-r-here">You Are<br>On This<br>Page.<br>&#x25bc;</div>
                                                    &mvt:sub_category:name;
                                                </div>
                                            <mvt:elseif expr="subcatImage">
                                                <a href="https://&mvt:global:domain:name;/&mvt:sub_category:code;.html" title="&mvte:sub_category:name;" class="o-layout__item sub-category">
                                                    <img class="lazyload" src="&mvte:global:theme_path;/images/img_transparent_category_thumb.png" data-src="&mvte:global:subcatImage;" alt="&mvte:sub_category:name;" title="&mvte:sub_category:name;" />
                                                    <noscript><img src="&mvte:global:subcatImage;" alt="&mvte:sub_category:name;" title="&mvte:sub_category:name;" /></noscript>
                                                    &mvt:sub_category:name;
                                                </a>
                                            <mvt:else>
                                                <a href="https://&mvt:global:domain:name;/&mvt:sub_category:code;.html" class="o-layout__item sub-category">&mvt:sub_category:name;</a>
                                            </mvt:if>
                                        </mvt:foreach>
                                    </div>
                                </nav>
                            </div>
                        </mvt:if>
                Thanks
                Nick Harkins
                www.loveisarose.com
                *Web Developer
                *Miva
                *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

                Comment


                  #9
                  Probably not of any significance...its just future proof.
                  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


                    #10
                    I like future proof. One less item to assign to the page template as well. Thanks
                    Nick Harkins
                    www.loveisarose.com
                    *Web Developer
                    *Miva
                    *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

                    Comment


                      #11
                      Bruce - PhosphorMedia Nevermind. The code you provided does something slightly different.

                      I would need the "sibling" categories that share the same parent category.

                      Ex:
                      Parent cat
                      Sub cat 1, Sub cat 2, Sub cat 3, Sub cat 4 <---Siblings

                      The toolkit code shows each sibling category at the bottom of each sub cat page.
                      Nick Harkins
                      www.loveisarose.com
                      *Web Developer
                      *Miva
                      *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

                      Comment


                        #12
                        ok, maybe i'm having a dense day, but that's what the code should do.

                        If Parent Cat of Tortoiseshell is Asshole_Cats, then you should get:
                        Siamese, Persian, Burmese
                        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


                          #13
                          Bruce - PhosphorMedia for me, that code is listing the sub cats of the current category
                          Nick Harkins
                          www.loveisarose.com
                          *Web Developer
                          *Miva
                          *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

                          Comment


                            #14
                            Hmmm...yea, think i was being dense, try this:

                            Code:
                             
                               <mvt:do name="l.result" file="g.Module_Library_DB" value="CategoryList_Load_Parent( l.settings:category:parent_id, l.settings:sub_categories )" />     <mvt:foreach iterator="subcat" array="sub_categories">  <mvt:if expr="l.settings:subcat:code NE g.category_code">  &mvt:subcat:name;<br/>  </mvt:if>  </mvt:foreach>
                            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


                              #15
                              Bruce - PhosphorMedia there we go. Anyway to only show the categories that are active? Thanks
                              Nick Harkins
                              www.loveisarose.com
                              *Web Developer
                              *Miva
                              *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

                              Comment

                              Working...
                              X