What are the available variables for a product's canonical category code? My search skills were unable to locate anything already published. Thanks.
Announcement
Collapse
No announcement yet.
Canonical Category Code
Collapse
X
-
Re: Canonical Category Code
Dan is correct, only the canonical category id is available in the template code:
Code:&mvt:product:cancat_id; and l.settings:product:cancat_id
Code:<mvt:item name="toolkit" param="catinfo|catvar||l.all_settings:product:cancat_id" /> <mvt:item name="toolkit" param="vassign|cat_code|g.catvar:code" /> &mvt:global:cat_code;
Last edited by Brennan; 09-30-13, 01:54 PM.
Comment
-
Re: Canonical Category Code
The cancat_id will do just fine -- thanks for the help!Last edited by nottheusual1; 09-30-13, 02:04 PM.
Comment
-
Re: Canonical Category Code
There is on the latest version and on Bill's product page:
#144 Catinfo
http://www.emporiumplus.com/1AA00223.html
Comment
-
Re: Canonical Category Code
I think this is a good example of why we need documentation of all the standard variables that are available in the Miva environment. "cancat_id". Huh? I searched for so many different variations of "canonical" and "category" but didn't find it. I looked for the value that I expected, but that was a code (a string). The value "3" (representing the canonical category ID in the Tokens List) tells me nothing. If there had been a "cancat_code", value "NEWPRODUCTS" then I could have easily figured out the SMT variable that I needed. "cancat_id" value "3" among all those other tokens means nothing (unless you already know what it means).
Kevin Garrett
Comment
-
Re: Canonical Category Code
I actually found the cancat_id variable, but did not know I could extract the code using that toolkit function. Now I know I can extract the code with g.catvar:code but who knows what else is in that catvar object. I'll mess around with it the next time I need something from a canonical category and see what I can find.
Comment
-
Re: Canonical Category Code
There's not really much to a category, so I can't imagine it's a long list. Once you've got the category code, there isn't much you can't do with toolkit or native SMT, anyway. We've been looking at it as a means to display featured products from a product's "home" (concat) category if they found the product via a "generic" category (like things in a specific color) versus a "brand" or "collection" category.
Plus, we want to use it to steer customers to specific packaging options (like gift boxes) based on the "home" category which will equate to a specific supplier.
If you'd reach out to Bill (WCW) I'm sure he could flesh out anything you want to know about the catvar object.
Comment
-
Re: Canonical Category Code
Yes, who knows what else? I guess Weiland does, but an enumeration of the vars is not in the documentation.
155. Use catinfo to retrieve most of the variables related to a specific category.
This is my biggest headache with Miva, and one that's been there since I opened my store in 2005 -- A lack of good documentation. I don't claim to be a great programmer, or even a good one. But over the years I've learned and used several proprietary scripting languages (Hypertalk, Supertalk, Usertalk, Applescript, etc.) as well Perl, PHP, and ASP (and Fortran and Basic!). In none of them have I spent so much time engaged in trial and error as I have trying to code in SMT.
Kevin Garrett
Comment
-
Re: Canonical Category Code
So color me confused, which seems to be extremely easy today. I thought you could include the category link just by selecting Include Category Code in the Product Links dropdown on the Category Product List Layout screen. Or is this something entirey different being done here?
This thread caught my eye because if this is selected, then the Canonical URL link rel="canonical" needs to be changed to include the category code, but then what happens to the SEO Short link settings that includes a Category Identifier such as "category"? Is there a way to conditionally sniff it out since it's possible that not every URL to a product with have a category code in it.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
-
Re: Canonical Category Code
When you select to include Category in the link Miva will insert whichever Category the product is being accessed from. If you have the product in two different categories, there will be three different links to it. One with "product" in the URL, one with Category1 in the URL, and one with Category2 in the URL.
That's aside from wanting your canonical url to include the code of the canonical category (which might be Category1) regardless of which category the crawler visits the product page from.
Currently we just use the "product" version of the link as the canonical url because at the time I didn't know there was an easy way to access the canonical category code. This is also incredibly useful if you happen to mess up your assignment of canonical categories. For some reason it's possible to assign a canonical category that the product doesn't even belong to, which makes a complete mess of breadcrumbs. But that's for another day.Last edited by Canexan; 12-04-13, 01:35 PM.
Comment
Comment