Originally posted by Kent Multer
View Post
Announcement
Collapse
No announcement yet.
Read_Product for meta fields
Collapse
X
-
-
Maybe I can save you the trouble. The library function Product_Load_ID only reads from the store's Products table. It doesn't retrieve data about meta-tags.
Leave a comment:
-
Originally posted by Bruce - PhosphorMedia View Postok, fair enough...did you try the suggestion and what was the result? :)
Leave a comment:
-
ok, fair enough...did you try the suggestion and what was the result? :)
Leave a comment:
-
Originally posted by Bruce - PhosphorMedia View Post
to both? (there where two questions)
Leave a comment:
-
Originally posted by lesliekirk View PostTo answer Bruce's question - yes.
Leave a comment:
-
It should be noted that I'm trying to integrate this into the sub-sub-category template that pulls products into it (from sub-sub-categories).
To answer Bruce's question - yes.
Leave a comment:
-
Have you checked if
(or whatever the actual code name is for your robots meta data is (check in Global Settings | Meta Data Settings under 'name')?&mvt:product:metafield:robots;
If not, you could try running
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_ID(id, product var)" />
and see if that has the variable loaded in.
Leave a comment:
-
I have a most ignorant follow-up question for this. If "customfields" is the mvt:item name for the Product Read to find the custom field "notes", what would the mvt:item name be to find the metafield robots?
Leave a comment:
-
Originally posted by alphabet View PostThere is a code sample on Miva Docs:
https://docs.miva.com/code-samples/l...ct-meta-fields
Code:<mvt:foreach iterator="meta_item" array="product:meta_items"> <mvt:if expr="l.settings:meta_item:name EQ 'keywords'"> <mvt:assign name="l.settings:product:meta_keywords" value="l.settings:meta_item:value" /> <mvt:elseif expr="l.settings:meta_item:name EQ 'description'"> <mvt:assign name="l.settings:product:meta_description" value="l.settings:meta_item:value" /> <mvt:elseif expr="l.settings:meta_item:name EQ 'robots'"> <mvt:assign name="l.settings:product:meta_robots" value="l.settings:meta_item:value" /> </mvt:if> </mvt:foreach>
Thanks!
Leave a comment:
-
There is a code sample on Miva Docs:
https://docs.miva.com/code-samples/l...ct-meta-fields
Code:<mvt:foreach iterator="meta_item" array="product:meta_items"> <mvt:if expr="l.settings:meta_item:name EQ 'keywords'"> <mvt:assign name="l.settings:product:meta_keywords" value="l.settings:meta_item:value" /> <mvt:elseif expr="l.settings:meta_item:name EQ 'description'"> <mvt:assign name="l.settings:product:meta_description" value="l.settings:meta_item:value" /> <mvt:elseif expr="l.settings:meta_item:name EQ 'robots'"> <mvt:assign name="l.settings:product:meta_robots" value="l.settings:meta_item:value" /> </mvt:if> </mvt:foreach>
Leave a comment:
-
Meta-tags are controlled by a module that comes standard with all stores. There's a version in the LSK named mmlsk-cmp-mv-prodctgy-meta.mv. A quick look at the source code suggests that, Yes, you can write template code to read the values, but it might take two or three mvt:do tags to do it; it's not as simple as custom fields.
Leave a comment:
-
Read_Product for meta fields
Is there a way to do something like this but for the meta fields instead of the custom fields?
Code:<mvt:item name="customfields" param="Read_Product_ID(l.settings:product:id, 'notes', l.settings:product:notes)" />
Tags: None
Leave a comment: