Is is possible to add meta information dynamically from an xslt-file..
I have a xslt file for the product page: http://sub.ak-security.dk/da/shop/brandmateriel/ildslukker.aspx with a Facebook Like button.. but Facebook not always detect this right image to use.. so I think I need to add something like this in the head section, the specify the image:
Treat this as any other element you need to output - grab the data from Umbraco and output it somehow.
Assuming you're in XSLT here, you'd have a macro in the head section of the template - since you're outputting an image url, you could just modify a macro that outputs an image, and output this meta element instead.
Where is your image located - is it an Upload field or a Media Picker somewhere?
Yes, I was thinking I could do it that way.. just wondering if it was possible to do it direct from the product xslt file..
I'm using DAMP, so I can add multiples images for each product.. either on the product itself or the variants.. I already had a variable to use the product image of the product.. if it hasn't one it uses the first variant image.. otherwise it just display an empty image graphic using ImageGen altImage parameter.. :
which works as expected.. a small thing is, when there isn't an image on the product og variant, I want to use an empty image graphic, but with the code above I only get the first part of the url with the domain.. I need to get /gfx/no_image.gif too.. on the productimages it's working..
I noticed that I could use this tool http://developers.facebook.com/tools/debug to check if the tags and content is correct.. It is also required to use: title, type, image, url, site_name and an id with fb:admins or fb:app_id to get it working..
Add meta from xslt
Hi..
Is is possible to add meta information dynamically from an xslt-file..
I have a xslt file for the product page: http://sub.ak-security.dk/da/shop/brandmateriel/ildslukker.aspx with a Facebook Like button.. but Facebook not always detect this right image to use.. so I think I need to add something like this in the head section, the specify the image:
according to this: http://developers.facebook.com/docs/reference/plugins/like/
I have variables for product an variants, so I can easily get the right image..
Bjarne
Hi Bjarne,
Treat this as any other element you need to output - grab the data from Umbraco and output it somehow.
Assuming you're in XSLT here, you'd have a macro in the head section of the template - since you're outputting an image url, you could just modify a macro that outputs an image, and output this meta element instead.
Where is your image located - is it an Upload field or a Media Picker somewhere?
/Chriztian
Hi Chriztian..
Yes, I was thinking I could do it that way.. just wondering if it was possible to do it direct from the product xslt file..
I'm using DAMP, so I can add multiples images for each product.. either on the product itself or the variants..
I already had a variable to use the product image of the product.. if it hasn't one it uses the first variant image.. otherwise it just display an empty image graphic using ImageGen altImage parameter.. :
Both the product and variants (children) is using the Product doc type and have the same properties..
Bjarne
Hi..
I created a new xslt file and used this code.
which works as expected.. a small thing is, when there isn't an image on the product og variant, I want to use an empty image graphic, but with the code above I only get the first part of the url with the domain.. I need to get /gfx/no_image.gif too.. on the productimages it's working..
I noticed that I could use this tool http://developers.facebook.com/tools/debug to check if the tags and content is correct..
It is also required to use: title, type, image, url, site_name and an id with fb:admins or fb:app_id to get it working..
Bjarne
I'm not sure I can have the url to the static image inside the mediaImageXml.. when I then use node-set on that variable..
But I solved it this way:
Bjarne
is working on a reply...