I'm trying to get my site working in Miva 10 after removing My Sebenza modules to be able to upgrade. I have some Category Custom Fields that are vital to my Category pages, but Miva is not reading them. Does there need to be an Item for Category Custom Fields? I can't find one and I think I have all Items that were there in Miva 9. Is this something that was in the Sebenza module? My product custom fields work OK with the customfields item.
How to get Category Custom Fields to work?
Collapse
X
-
-
Don't forget to make sure your Category Custom Fields are assigned within the Category Tree section.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: X | Facebook | Pinterest
-
There are functions you can use to pull in custom category fields on any page:
https://docs.miva.com/template-langu...ategory-fields
Comment
-
Also, shortcut if you don't have too many category custom fields
<mvt:item name="customfields" param="Write_Category_Code( l.settings:category:code, '', l.settings:catCustom )" />
Now, all category custom fields will be available on the l.settings:catCustom branch. For example, a custom field with the code 'showThis' will now be available via
l.settings:catCustom:showThis AKA &mvt:catCustom:showThis;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
-
How do you assign the fields within the category section? I have them selected on list in Global Settings. However, I have put a hard coded category tree (the one that we used with the Sebenza Cattree modules) into the Category Tree. That works fine for Selecting categories in CTGY but doesn't have any way of processing the custom field values in the category tree. The Custom fields are called in the Header of the product list section of CTGY That code is essentially our custom version of the Sebenza Product Template. Other things work there, but the custom category fields don't work.
Comment
-
I know it sounds odd to assign the Custom Category Fields within the Category Tree Template, I never really understood why Miva did it this way, but that's where you go to assign them to use for the CTGY template.Originally posted by Earwicker23 View PostHow do you assign the fields within the category section? I have them selected on list in Global Settings. However, I have put a hard coded category tree (the one that we used with the Sebenza Cattree modules) into the Category Tree. That works fine for Selecting categories in CTGY but doesn't have any way of processing the custom field values in the category tree. The Custom fields are called in the Header of the product list section of CTGY That code is essentially our custom version of the Sebenza Product Template. Other things work there, but the custom category fields don't work.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: X | Facebook | Pinterest
Comment
-
So I have tried several of the suggestions in this thread so far, and none of them seem to work. Either I don't understand this, or MIVA 10 doesn't understand me. I have under 10 Category Custom fields and many more Product Custom fields. The Product Custom fields all work and allow us to control the custom tab interface on our product pages. The Category Custom fields are supposed to work in the product list header of the CTGY page. One of them is for an image, and the others are supposed to control the tabs that pass detailed category information. The data are all present in the custom fields for the categories but are not getting read in the CTGY page. The Custom fields are selected in the list on the Category Tree page. There is active code in the Category Tree to control whether it is open or closed but otherwise it is just a structured list with formating controlled by css and hard code to tell it which product list to pull up. The CTGY page code is essentially what we used for the most used Sebenza Category module. Sebenza had a separate category tree (cattree) where we put the hard coded tree structure that we are now using in category_tree. I notice on the PLST template page there is a Layout page that has a Product-Category Page layout on it but it doesn't add any category Custom fields to the selection list if you select it. Somewhere I was in a page that ran some code for the product custom codes when I selected them; I think that was in advanced mode.
Somehow there has got to be a way to get the Category Custom Fields to work on the CTGY page!
Comment
-
Two things to maybe help you a little bit. As mentioned, make sure the Custom Fields are assigned:
GmAZod.png
Then make sure you are using coding that will display those fields. This is a code snippet that is in a CTGY template I've worked on (there are two slightly different methods here). The coding is for the Custom Category Field "daisy" and the Custom Category Field "altcatname":
There are slightly different methods that can be used and hopefully others will feel free to adjust what I have shared.Code:<mvt:if expr="l.settings:category_title:image"> <section class="o-layout u-hidden u-flex--l"> <div class="o-layout__item"> <mvt:item name="customfields" param="Read_Category_Code( l.settings:category:code, 'daisy', l.settings:daisy )" /> <mvt:if expr="l.settings:daisy"> <span class="x-product-label"><img src="graphics/00000001/LittleDaisy_transparent.png"></span> </mvt:if> <div class="x-hero" title="&mvte:category:name;"> <img src="&mvte:category_title:image;" alt="&mvte:category:name;"> </div> <br> </div> </section> <mvt:elseif expr="l.settings:customfield_names:customfields:altcatname"> <section class="o-layout u-hidden u-flex--l"> <div class="o-layout__item"> <div class="x-hero" title="&mvte:category:name;"> <mvt:item name="customfields" param="Read_Category_Code( g.Category_Code, 'altcatname' )" /> <h1 class="c-heading-delta u-color-red t-page-title">&mvte:customfields;</h1> </div> </div> </section> <mvt:else> <section class="o-layout u-hidden u-flex--l"> <div class="o-layout__item"> <div class="x-hero" title="&mvte:category:name;"> <h1 class="c-heading-delta t-page-title">&mvte:category:name;</h1> </div> </div> </section> </mvt:if>
Hope that helps a little more.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: X | Facebook | Pinterest
Comment
-
LOL! 20 plus years and I never knew that...but then, I still find making my own variable name MUCH easier, especially if you have to use the long form in conditionals.Originally posted by lesliekirk View Post
I know it sounds odd to assign the Custom Category Fields within the Category Tree Template, I never really understood why Miva did it this way, but that's where you go to assign them to use for the CTGY template.
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
-
Thanks for the help. I've got my custom fields selected by the category tree. I unselected and reselected them just in case. AS near as I can tell I have valid code in the CTGY page but it doesn't seem to select any category codes. My custom product codes all work but the category codes don't. The code we have in there for that all works fine in MIVA9, but doesn't work for custom category fields in Miva10. I also noticed that the customfields Item is not assigned in either CTGY or PROD in Miva 9 (with the Sebenza modules installed). I have it selected in both in Miva 10.
I have some code commented out in Miva 10 CTGY and am trying to uncomment it but I can't find the start so it's possible that is what's causing the problem, but I don't think that's it. I think the problem is that with a hard coded Category Tree there must be some code missing that would make it work. My CTGY code is essentially what we had working in the Sebenza Category template, where it worked in previous versions. But that got it's Category tree information from the Sebenza cattree module, and that hard coded tree is what I have installed in the Miva 10 category_tree. It has no active Miva code in it; it runs some Project VII code in it that opens and closes the category tree (and is in css or javascript) and works OK. The custom fields are necessary to interface with the PVII stuff to make our tabs work and the category tree stuff doesn't work because Category custom fields are not being read.
You can look at that stuff on our website at www.wingedseed.com. Go to the storefront and select a category like absolutes or concretes to see how it works. In our dev2 page the tree works fine but the image doesn't show up. I have the Overview tab and the Popular tab disabled, but some of the overview stuff is supposed to show up at the top of the page and prompt the user to open a tab.
I'm going to bed and will pursue this tomorrow. If you have any other suggestions let me know.
Comment
-
sounds like you may not have the cat tree item expressed on the page (<mvt:item name="cattree"/> i think*)
but, why not just use
<mvt:item name="customfields" param="Write_Category_Code( l.settings:category:code, '', l.settings:catCustom )" />
Now, all category custom fields will be available on the l.settings:catCustom branch. For example, a custom field with the code 'showThis' will now be available via
l.settings:catCustom:showThis
AKA
&mvt:catCustom:showThis;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
-
It's not letting me post it all at once. Here is part 1 (Head stuff omitted.):
<body class="thrColFixHdr" onload="P7_initTP(10,1);P7_TBMmark(2,'storefront') ;P7_TPcd('p7tpb1_2','IMG');P7_TPcd('p7tpb1_3','A') ;P7_initTBM(1,2,1,1,200,6)">
<mvt:item name="customfields" param="Write_Category_Code( l.settings:category:code, 'INT', l.settings:catCustom )" />
<div id="main_container">
<div id="header">
<mvt:item name="hdft" param="global_header" />
</div>
<div id="sidebar_cattree">
<!--beginning of sidebar-->
<mvt:item name="category_tree" />
<!-- end #sidebar_cattree --></div>
Comment
-
-
So how do I link a code fragment or an image to this page? I've tried to paste stuff into a post here but get an error message if it's very big. I accidentally blew away my Editor Bar and don't know how to get it back. I realize this has nothing to do with this issue but I can't even discuss it intelligently without the ability to either link a file or post some code in the message. Help!
Comment
Comment