Esempio n. 1
0
        public static System.Web.Mvc.MvcHtmlString SocialShareOptions(this HtmlHelper helper, Telerik.Sitefinity.Model.IHasTitle dataItem, string templateName)
        {
            System.Web.Mvc.MvcHtmlString result;
            try
            {
                // Default Implementation from https://github.com/Sitefinity/feather/blob/68eb70be27d7925299002930b364088db2703f31/Telerik.Sitefinity.Frontend/Mvc/Helpers/SocialShareHelpers.cs
                RouteValueDictionary routeValues = new RouteValueDictionary();
                routeValues.Add(SocialShareOptionsHelper.DataItemKey, dataItem);
                // Add template name
                routeValues.Add(TemplateNameKey, templateName);
                result = helper.Action(ActionName, ControllerName, routeValues);
            }
            catch (HttpException)
            {
                result = new System.Web.Mvc.MvcHtmlString("The SocialShare widget could not be found.");
            }

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// Socials the share options. Redirect to the SocialShare control if exist else render error message
        /// </summary>
        /// <param name="helper">The HTML helper.</param>
        /// <param name="dataItem">The data item which we will be sharing</param>
        public static System.Web.Mvc.MvcHtmlString SocialShareOptions(this HtmlHelper helper, Telerik.Sitefinity.Model.IHasTitle dataItem)
        {
            System.Web.Mvc.MvcHtmlString result;
            try
            {
                RouteValueDictionary routeValues = new RouteValueDictionary();
                routeValues.Add(SocialShareHelpers.DataItemKey, dataItem);
                result = helper.Action(ActionName, ControllerName, routeValues);
            }
            catch (HttpException)
            {
                result = new System.Web.Mvc.MvcHtmlString("The SocialShare widget could not be found.");
            }

            return(result);
        }
Esempio n. 3
0
 public static MvcHtmlString SocialShareOptions(this HtmlHelper helper, Telerik.Sitefinity.Model.IHasTitle dataItem)
 {
     return(null);
 }