Go to main content

Social media share urls enhanced by Kentico macros

Requirements of nearly every website ask us to incorporate links for sharing content on social media. There are tools out there which generates these links for us. But what if we want to generate them automatically on our websites?

Social media share urls enhanced by Kentico macros

In this short article I will provide you with Twitter, Facebook, LinkedIn and Google+ share urls enhanced by Kentico macros which you can place in your template and let them generate automatically.

https://twitter.com/home?status={% UrlEncode(CurrentDocument.DocumentName)#%}%20{% UrlEncode(CurrentDocument.AbsoluteUrl)#%}

http://www.facebook.com/sharer/sharer.php?u={% CurrentDocument.AbsoluteURL #%}

https://www.linkedin.com/shareArticle?mini=true&url={% CurrentDocument.AbsoluteURL #%}&title={% UrlEncode(CurrentDocument.Name)#%}&summary=&source=

https://plus.google.com/share?url={% CurrentDocument.AbsoluteURL #%}

Further reading

all posts
  • Kentico EMS & Xperience

    Sync form submissions with Integration bus in Xperience by Kentico

    In this post, I will provide you with a code snippet and tips on how to synchronize new form submissions with an external system through its REST API using the Integration bus in X…

  • Front-end & JavaScript

    Table of contents in Javascript

    In this post, I will provide you with a javascript code sample that transforms headings in a page into a structured table of contents with anchor links.

  • Kentico EMS & Xperience

    What is Kentico

    In this article you'll find a short summary about what Kentico is.