Skip to content

Instantly share code, notes, and snippets.

@pawelgur
Created August 4, 2014 20:30
Show Gist options
  • Save pawelgur/67d4beb7904ee7859397 to your computer and use it in GitHub Desktop.
Save pawelgur/67d4beb7904ee7859397 to your computer and use it in GitHub Desktop.
Partial view for displaying standard sharing buttons
@inherits Umbraco.Web.Mvc.UmbracoViewPage<IPublishedContent>
@using ClientDependency.Core.Mvc
@{
Html.RequiresJs("~/Scripts/modules/social.js", 20);
String shareUrl = library.NiceUrlWithDomain(Model.Id);
String text = Model.Name;//Umbraco.StripHtml(Model.GetPropertyValue<String>("bodyText")).ToString().Substring(0, 100);
}
<ul class="def_post-sharing-buttons">
<li class="twitter">
<a href="https://twitter.com/share" class="twitter-share-button" data-lang="en" data-url="@(shareUrl)" data-text="@text" data-count="horizontal" >Tweet</a>
</li>
<li class="linkedin">
<script type="IN/Share" data-counter="right" data-url="@shareUrl" data-showzero="true"></script>
</li>
<li class="facebook">
<div class="fb-like" data-href="@shareUrl" data-send="false" data-layout="button_count" data-width="45" data-show-faces="false" data-font="arial"></div>
</li>
<li class="google">
<div class="g-plusone" data-size="medium" data-href="@shareUrl"></div>
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment