1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Wrapped Generic Content and Social Bookmarking

Wrapped Generic Content and Social Bookmarking

2 posts, 0 answered
  1. Scott Harrington
    Scott Harrington avatar
    28 posts
    Registered:
    21 Sep 2009
    17 Dec 2009
    Link to this post
    Hello,

    I've created a wrapped generic content user control and I'd like to add social networking to this user control.  Here is my server-side code to show what I am doing exactly:

    public partial class NewsDisplay : System.Web.UI.UserControl  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {     
            NewsManager newnewsManager = new NewsManager("News");  
     
            if (!string.IsNullOrEmpty(Request.QueryString["nid"]))  
            {  
                IContent contentItem = newsManager.Content.GetContent(new Guid(Request.QueryString["nid"].ToString()));  
                        
                GenericContent1.Content = contentItem.Content.ToString();  
            }  
            else  
            {  
                GenericContent1.Content = "Sorry, the news article could not be found.";  
            }  
        }  

    I didn't see any properties off of the GenericContent1 item?  Would I need to inherit from IGenericContent in order to use social networking and will this break my existing functionality?  Ideally I'd like to just add code and not rewrite the code as I've got this working exactly the way we need it.  Any help would be great, thanks for the help!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    17 Dec 2009
    Link to this post
    Hello Scott Harrington,

     1. GenericContent does not support social bookmarks - it just represents the content of a shared content or you set the RadEditor.Content property if you type any text inside the control. You have to use ContentView based control like ContentView, NewsView, EventsView etc.

    ContentView view = new ContentView;
    view.SocialBookmarkImageFolder = "RELATIVE PATH TO THE FOLDER";
    view.SocialBookmarkTemplate = "RELATIVE PATH TO THE TEMLATE";
    ....
        ....

    2. GenericContent cannot be wrapped in user control. You can take a look at wrap generic content control


    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered