More in this section

Forums / Developing with Sitefinity / Blog Recent Posts

Blog Recent Posts

6 posts, 0 answered
  1. Nigel
    Nigel avatar
    38 posts
    Registered:
    01 Dec 2004
    11 Apr 2008
    Link to this post
    Hi,

    Very new to SiteFinity, hope someone can point me in the right direction.

    I would like to display recent post titles (n number) in a simple unordered list on my post page.

    Many thanks


  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    12 Apr 2008
    Link to this post
    Hello Nigel Kennedy,

    There is a special user control for that purpose. While editing the page, drag the Posts List control (contained in Blogs section). You will see all of your posts, with their details - Title,Content, Comments and so on. We could change the number of the posts showing from "Edit->Paging->ItemsPerPage" of the Post Lists control.
    Now as we would like to show only the Titles of the blogs, we have to change the Post Lists template. The template's location is \[YourProject]\Sitefinity\ControlTemplates\Blogs\ContentViewItemList.ascx. You could backup this file, and edit it, so your template holds only the title of the blogs.

    I have made this modification for you as an example (it's attached), just copy it to your templates. Note that you could different templates for your controls, and tell the control which template to use. You could do this this way - edit the Blog Posts control ->  Appearance-> ItemListTemplatePath

    I hope you find this answers helpful.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Nigel
    Nigel avatar
    38 posts
    Registered:
    01 Dec 2004
    15 Apr 2008
    Link to this post
    Georgi

    Thanks for the information.

    I had been trying this method you recommend using the Blog Posts control - but because I was trying to show recent posts on individual post pages, this control was reverting to the contentviewsingleitem template. I had also reflected the Telerik.Blogs.Webcontrols to see if there was a control in there that might do what I wanted and noticed that the Posts List control was marked as obsolete.

    Anyway, I got this working using the ContentView control in Display mode ItemList with the provider set to Blogs.

    Cheers
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    15 Apr 2008
    Link to this post
    Hi Nigel Kennedy,

    I am glad that you were able to solve the problem yourself and apologize that I could not help you right away. If I should be honest, this is a pretty nice trick, since the Blogs module is Generic-Content-based.

    Don't hesitate to contact us if you have other questions.

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Keith
    Keith avatar
    5 posts
    Registered:
    28 Jun 2008
    25 Nov 2008
    Link to this post
    Hello,

    I was trying to accomplish the same thing, I tried the Generic Content control, with the settings you mentioned, but I must be missing something since the control loads the entire post, not just the title. I also tried putting another instance of the blog module in a sidebar on the blog page, and limited (supressed) the output of everything but the title, however, I couldn't figure a way to have the title style being different from the full post blog module (since I guess the module itself derives it's CSS classes from the same place. Does anyone know a solution for this? I would like to simply have the Blog title, line by line for each blog post with a restriction of say the 5 most recent.

    TIA,

    Keith Waldron
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    28 Nov 2008
    Link to this post
    Hi Keith,

    You can now do this only by adjusting a few settings in the BlogPosts control. Just place such control on your page, click on "Edit", select "List and Page" option for your blogs, and browse to Settings screen.
    From this screen you can control which items of the blogs you want to show and hide. Please check the attached screenshots of these settings and results I get.

    I hope this helps.

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
6 posts, 0 answered