This uses a text page field to populate the tag. Is it possible to populate the tag using the URL from a Media Picker property? On inserting the page field I can only get the image id number.
It would be neater doing this with a macro I reckon. Create a macro (here, I'm using XSLT) called 'metaImage' with a macro parameter with an alias of 'imageId' and type 'number'. Then put something like this in your macro to render the path of the image in a meta tag:
How to populate image meta tag
I am currently using umbraco:Items to populate meta tages in my template header.
This uses a text page field to populate the tag. Is it possible to populate the tag using the URL from a Media Picker property? On inserting the page field I can only get the image id number.
Hi Keir,
It would be neater doing this with a macro I reckon. Create a macro (here, I'm using XSLT) called 'metaImage' with a macro parameter with an alias of 'imageId' and type 'number'. Then put something like this in your macro to render the path of the image in a meta tag:
Then just call this macro in your template using advanced macro parameter syntax to pass the media id to your macro like this:
Much cleaner than trying to get it formatted in the template directly, it should render something like this in the browser:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.