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

Forums / Developing with Sitefinity / New Post in Blog/News for all users

New Post in Blog/News for all users

4 posts, 0 answered
  1. Muhammad Saqib
    Muhammad Saqib avatar
    95 posts
    Registered:
    09 Sep 2009
    05 Nov 2009
    Link to this post
    Hi,

    I want All users (Can be Role based) to post in blogs and post news rather going into Administration Interface,
    I meanI want to have a Post New Topic Link on my Blog page to let my users post new topics in that blog.
    Secondly, is there any module/ help , how can i implement rating into my Blog Posts , and obviously those posts belongs to some user so i can calculate rating of that user based on his posts rating..
    Please let me if there is any misunderstanding, but i hope you can understand the basic idea which i am talking abt.

    Regards
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Nov 2009
    Link to this post
    Hello Muhammad Saqib,

    To create blog posts form the front end you need to develop a public control that will be visible only for your authenticated users. You need to work with ContentManager and BlogsManager classes. You can gather more information at Overview of Generic Content API.

    As for the rating - we will support this functionality out of the box from Sitefinity 4.0 where we will use Rating / First Look

    Kind 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.
  3. Muhammad Saqib
    Muhammad Saqib avatar
    95 posts
    Registered:
    09 Sep 2009
    05 Nov 2009
    Link to this post
    What if i want to implement rating now??
    Secodnly i am not very good with sitefinity development for now.
    so can  you please guide me on implementing "post new topic" in blog for all users. any code snippet or steps.
    Thanks
    is there any release date for sitefinity 4.0
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Nov 2009
    Link to this post
    Hello Muhammad Saqib,

    To implement rating for Sitefinity 3.x you need to follow the steps below

    1. You need to modify ListPageMaster template of BlogPosts control (or any other ContentView based control). This is the public template that lists all posts. If you want to do it for each singe post you should map ListPageDetail template. More information about mapping the templates can be found at Working_with_Presentation_Modes. In your template add RadRating control.

    <telerik:RadRating ID="rating" runat="server"  ItemCount="5" 
    OnClientRating="OnRatingPreview" />


    2. Create a new metakey for yuor blogs provider that you need to use for storing the data. The metakey could be of type FloatingPoint or Integer.
    3. Create a Web Service with web methods that you will call through js to set the valule of the rating..

    sample

    public void SetRating(Guid contentId, int value)
    {
        ContentManager mgr = new ContentManager();
        var cnt = mgr.GetContent(contentId);
        if (cnt == null)
        {
            return;
        }
     
        cnt.SetMetaData("rating", value);
    }
     
    public int GetRating(Guid contentId)
    {
        ContentManager mgr = new ContentManager();
        var cnt = mgr.GetContent(contentId);
        if (cnt == null)
        {
            return 0;
        }
     
        return cnt.GetMetaData("rating");
    }

    function OnRatingPreview (radRating, args) {
              var value = args.get_newValue();
               // here you call your service

    To set the initial value of RadRating control you need to subscribe for the ItemDataBound event of the ListPageMaster (ListPagDetails) repeater . Inside the repeater find the RadRating control and set "value" double type property.

    All the best,
    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.
Register for webinar
4 posts, 0 answered