Is there a way to display a related categories in CTGY page?
Announcement
Collapse
No announcement yet.
Is there a way to display a related categories in CTGY page?
Collapse
X
-
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
-
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>
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
-
Originally posted by Bruce - PhosphorMedia View PostHow 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>
Thank you, Bill Davis
Comment
-
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
-
Originally posted by Bruce - PhosphorMedia View PostIf 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.Thank you, Bill Davis
Comment
-
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
-
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>▼</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>
Nick Harkins
www.loveisarose.com
*Web Developer
*Miva
*Google Analytics, Search Console, Tag Manager, Merchant Center, Ads
Comment
-
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
-
I like future proof. One less item to assign to the page template as well. ThanksNick Harkins
www.loveisarose.com
*Web Developer
*Miva
*Google Analytics, Search Console, Tag Manager, Merchant Center, Ads
Comment
-
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
-
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, BurmeseBruce 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
-
Bruce - PhosphorMedia for me, that code is listing the sub cats of the current categoryNick Harkins
www.loveisarose.com
*Web Developer
*Miva
*Google Analytics, Search Console, Tag Manager, Merchant Center, Ads
Comment
-
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
-
Bruce - PhosphorMedia there we go. Anyway to only show the categories that are active? ThanksNick Harkins
www.loveisarose.com
*Web Developer
*Miva
*Google Analytics, Search Console, Tag Manager, Merchant Center, Ads
Comment
Comment