Announcement
Collapse
No announcement yet.
Subcategory_Listing without Category Tree
Collapse
X
-
The path to your category title image is contained in the variable"&mvt:subcat:title_image;", based on the code you supplied.
-
How do we get the category title image when not in the category tree.
I am using the code from brennan, but I still need the images for each of those submits.
This is what I want.. but how do I get the images for all those subcats?
[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:subcat:active;
&mvt:subcat:agrpcount;
&mvt:subcat:code;
&mvt:subcat:disp_order;
&mvt:subcat:id;
&mvt:subcat:name;
&mvt:subcat:parent_id;
&mvt:subcat:title_image;
</mvt:foreach>
[code]
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
Just realized I had posted in a thread regarding the Bootstrap Base ReadyTheme. Does the same apply to the Iron & Wool ReadyTheme?
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
That code was added before mvt:do existed. That does require the category tree to work.
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
The question still becomes - why is the sub_categories code that is used in the Content (subcategory_listing) dependent upon the cattree being active? Why can't it work even if the cattree is not part of the CTGY page?
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
@eldon99
No toolkit is not going away. The built in functions provide a way to get the same functionality without a module.
@leslie
The built in version of subcategory can be used anywhere, you will just need to pass in the correct variable for the Category Code. This will change depending on where you are using it.
On the CTGY page it would look something like this:
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:subcat:active; &mvt:subcat:agrpcount; &mvt:subcat:code; &mvt:subcat:disp_order; &mvt:subcat:id; &mvt:subcat:name; &mvt:subcat:parent_id; </mvt:foreach>
1. Loading all the category information for category with code of g.Category_Code and saving it into a variable called l.settings:current_category
2. Loading all the categories which have the parent category of l.settings:current_category:id and saving them into an array called l.settings:sub_categories
3. Looping though the sub_categories array and displaying their information.
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
Okay, so I'm stuck on this again - the CTGY Page is not using the category tree. Why does it seem that this code is dependent upon using the category tree? Seems I too had to use the Toolkit function for another site in the same situation...
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
It does. I have decided to punt and use the Toolkit subcat function: # 23. That worked like a charm.
Is Toolkit going away in favor of the new built-in functions? If so, I would like to request some major video training. I struggle enough as it is with Toolkit, let alone have to learn a whole new way of doing things.
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
Does the &mvt:global:category_code; render anything when you load the page? If not, then you will need to devise a way to set the g.category_code to the Category_Load_Code function as it is not present.
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
I have 5.22 and have also added &mvt:global:category_code;, still no go.
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
You need to be on Miva Engine 5.22 and you should have g.Category_Code present on your page.
You can find your engine version on the home page of your admin and you can render the Category Code this way:
Category Code: &mvt:global:catgory_code; <br>
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
Thanks for the reply folks. I copied the subcat code from the blog post from Bennen, but it is not displaying anything. Not sure if it needs to go inside the Category Listing template, or if it can be in the same place as the original subcat code. Is there an item(s) I need to enable to get this to work?
Thanks!
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
Great list Brennan!
To get the Category Image you can use:
Code:<mvt:do file="'/mm5/5.00/modules/component/cmp-cssui-cattitle.mvc'" name="g.has_cat_title" value="CSSUI_CatTitle_Load(l.settings:category:id, g.cat_title)" />
@Eldon - Take a look at mivascript.com, it is a great resource and has a lot of functions that you can use with mvt:assign.
(It would be nice to have a sticky on mvt:do)
Leave a comment:
-
Re: Subcategory_Listing without Category Tree
See the subcat example here:
http://www.miva.com/videos/articles/...ement-examples
Leave a comment:
-
Subcategory_Listing without Category Tree
Using the Base Bootstrap Framework. If I comment out the CatTree, the subcategory_listing does not show. How can I display the subcategory_listing without having to display the left CatTree? Will I need to use Toolkit instead?
Thanks for any insight.
Regards,
EldonTags: None
Leave a comment: