jxycms
11/23/2016 - 2:30 AM

Twitter sharing

Twitter sharing

//The card type, which will be one of “summary”, “summary_large_image”, “app”, or “player”.
<meta name="twitter:card" content="summary_large_image" />

<meta name="twitter:site" content="@AbilityOptions" />
<meta name="twitter:creator" content="@AbilityOptions" />

//use Macro code to dynamically get the information from source html of sharing page
<meta property="og:url" content="{% CurrentDocument.AbsoluteURL #%}" />
<meta property="og:title" content="{% CMSContext.Current.CurrentDocument.DocumentPageTitle #%}" />
<meta property="og:description" content="{% CMSContext.Current.CurrentDocument.DocumentPageDescription #%}" />

//HeaderImage is a property that could choose image from media libraries. The macro syntax here could get absolute url for HeaderImage
<meta property="og:image" content="{%GetAbsoluteUrl(HeaderImage.ToString())#%}" />

*optimal Facebook sharing image size: 1200*630