Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Macro for meta data in header View modes: 
User avatar
Certified Developer v6
Certified Developer v6
keiok-lincintegrated - 8/21/2013 10:28:39 PM
   
Macro for meta data in header
I am trying to add meta data for an image of page.

with this, never write the html code... but if i check !="<a string here>" it work for condition but not the data bind in html code
***********************
{%if (dataRow["MenuItemTeaserImage"].ToString() != ""){return "<meta property=\"og:image\" content=\"http://"+ Domain +"/cms/getattachment/"+ dataRow["MenuItemTeaserImage"].ToString() +"/"+ "\" />"}%}
***********************

I read the guide for K#, method and parameters.... however, it confused me that when to use method and when to use parameters way to do... or they can use together??

Anyone have idea, please share with me. Thank you very much!!

User avatar
Kentico Support
Kentico Support
kentico_janh - 8/22/2013 1:41:58 AM
   
RE:Macro for meta data in header
Hello,

The first option should work with small changes:

{% if (CurrentDocument.MenuItemTeaserImage.ToString() != ""){return "<meta property='og:image' content='http://"+ Domain +"/cms/getattachment/"+ CurrentDocument.MenuItemTeaserImage +"/"+ "' />"} %}


Best regards,
Jan Hermann