Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How to dynamically add the Open Graph metaproperties? View modes: 
User avatar
Member
Member
guillaume.marquilly-tv5monde - 3/27/2012 5:38:07 AM
   
How to dynamically add the Open Graph metaproperties?

Hello!,

I am currently working on a website (Kentico 6 SP1)

My problem here is to find the easiest and simplest way to provide to my social network controls, the metadata that they need.

I will take facebook as example:

1) I added a new facultative field in my CMS.MenuItem content type (MenuItemDescription). So the futur content managers just have to fill the Document Name, the Teaser Image and this new Description field to provide the required content to the social sharing features.

2) The second step is now to automatically generate the meta property tags in each content page. How can I do that easily?

Thank you in advance :)


User avatar
Member
Member
kentico_michal - 3/27/2012 6:04:27 AM
   
RE:How to dynamically add the Open Graph metaproperties?
Hello,

You can take advantage of the Head HTML code web part that allows you to insert custom HTML code into the HEAD element of the page. It has a property called HTML code in which you can specify a context macro so that the code is taken from the current document. For example, if the field that contains the metadata is called MenuItemDescription, you can specify the following macro with the default value for documents that do not have the MenuItemDescription field:

HTML code: {%MenuItemDescription|(default)default value%}


Best regards,
Michal Legen

User avatar
Member
Member
guillaume.marquilly-tv5monde - 3/27/2012 8:54:09 PM
   
RE:How to dynamically add the Open Graph metaproperties?
Thank you Michal, it is exactly what I needed, perfect in the Masterpage !

Best regards,

Guillaume