Using the News built in Model in Kentico

Yasmin Saad asked on October 22, 2017 12:43

Hi Guys, I'm new to kentico developing platform and I want to build news module to use it in my demo for the client . I want to put a web part in homepage to show the recent added news but all I can do is only create a separate page and implement news list in it .Could anyone guide me through this I feel a little lost :) Thank you

Correct Answer

Matt Nield answered on October 23, 2017 00:33

Hi - finally got to my laptop. So, to summarise what you want to do from your original post:

You want to be able to display the latest news on the homepage. You mention using a module, but also creating pages.

I'm going to make the following assumptions:

  1. You're using the out-of-the-box news page type News which has a code name of CMS.News.
  2. The News template is the out-of-the-box template with the code name cms.newslist.
  3. You do not already have news pages created.
  4. You want to show the three most recent news articles.
  5. Your content tree looks something like this:
    • Root
      • Home (template - Home page)
      • News (template - News list)
        • News article 1 (template - News list)
        • News article 2 (template - News list)
        • ...
        • News article n (template - News list)

Even if this is not the case, the following steps should see you right.

The Repeater web part allows you to specify a set of pages which you want to display some information for. Then, using a Transformation, the Repeater will format the information about the pages that have been retrieved on the page.

What you need to to is, in the Design tab of your home page, add a Repeater web part where you wish the latest news to be shown. Configure the web part with the following properties:

  • Page types: CMS.News
  • Order by: NewsReleaseDate DESC
  • Select only published: Checked
  • Select top N pages: 3
  • Transformation CMS.News.Preview

Once you save these changes, your home page should now show you the latest 3 news articles. This pretty much does what you need. There is a good high-level Getting started with Kentico tutorial that can walk you through the basics of using Kentico if that helps?


The News list template - as you stated - will display an index of News pages, unless you are looking at an individual News pages. In the tree I mentioned earlier, the News page can be a Page (menu item) page type, as it does not need to do anything special. But, on the Repeater used on the News list template, there is also a Selected item transformation set. When this is used, the web part is aware that the current page is CMS.News page, and so applies the other transformation, to provide a detail view, rather than a summary view.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Matt Nield answered on October 22, 2017 14:11

Hi Yasmin, what you're looking for are called web- parts, and in this instance, I would recommend the Repeater web part (I am assuming that you're using the portal approach rather than MVC).

When you add a Repeater web part to the page, you can configure which pages you want it to show and how it should be displayed by selecting a transformation. There's a good example of using the Repeater in the Kentico docs that will help to explain the approach.

When I get back to my laptop (this is my wife's and doesn't have Kentico on it), I'll pop in some step-by-step instructions for your demo if the above links don't help. Just let me know. :)

0 votesVote for this answer Mark as a Correct answer

Yasmin Saad answered on October 22, 2017 14:17

Thanks Matt really appreciate your help :) I'll read the document now and let you know :)

0 votesVote for this answer Mark as a Correct answer

Yasmin Saad answered on October 22, 2017 15:38

The document was a bit helpful but I feel really lost I cant show the news in the web part in the home page could you write a step by step process to create that . Thanks

0 votesVote for this answer Mark as a Correct answer

Matt Nield answered on October 22, 2017 16:12

Of course, it’ll be a little later when I get back to my laptop. In the meantime, can you let me know which page template you have for your homepage and which page type you are using for news so that the steps match for you a bit more?

0 votesVote for this answer Mark as a Correct answer

Yasmin Saad answered on October 22, 2017 17:18

Sure , I've created my custom master page template and I created a new page based on that master page so it inherits all the component there ,then I created a new page put when I choose the template I choose News template and I add News List in the page.When I create a blank page and I choose the News template it works fine . I'm a little confused though

0 votesVote for this answer Mark as a Correct answer

Matt Nield answered on October 23, 2017 13:13 (last edited on October 23, 2017 15:00)

I made a small example based on the above for you to look at as a guide. It's a very basic site that you can import into your Kentico instance, you can get it here: https://we.tl/hqLXPTWrlA

  • assuming you are on Kentico 10
0 votesVote for this answer Mark as a Correct answer

Yasmin Saad answered on October 23, 2017 16:51

Thankx matt so much for your help :) but I cant open the link

0 votesVote for this answer Mark as a Correct answer

Matt Nield answered on October 23, 2017 16:57

Hi, glad to help - I hope you enjoy your time with Kentico. I uploaded another copy of the export to upload.io - hopefully you can get it form here: https://ufile.io/kkhnt (it shoudl last for around 30 days).

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.