---
title: Example - Publishing community news
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

In this example, you will create a new section for publishing community news. Each registered site member can create new news items and edit/delete their previously posted news. The example assumes that you are using the **Corporate Site** sample website.

## Creating the community news section

1. Open the **Pages** application and **Create a blank page** called **Community news** under the **Examples** page.
2. Switch to the **Design** tab of the newly created page and add the **Repeater** web part. Set the following properties:
   - **Web part control ID:** repeaterNews
   - **Page types:** cms.news
   - **Transformation:** CMS.News.preview
   - **Selected item transformation:** CMS.News.default

![Community news section with a repeater](https://docs.kentico.com/docsassets/k81/example-publishing-community-news/community_news_section.png "Community news section with a repeater")

## Adding the New page button

Add the **Contribution list** web part to the Community news page. Set the following properties:

- **Show for page types:** cms.menuitem – this ensures that the web part is displayed only when the list of news is displayed, not on the news detail page.
- **Allowed new page types:** CMS.News – this means that the users will be allowed to create only news items under this section.
- **Display list of pages:** disabled – this ensures that the web part displays only the **New page** link, without displaying the list of pages.
- **Allow editing by users:** Authenticated – this means that only authenticated users will be able to edit/delete the page.

The web part displays the **New page** link. Try to create a new page using the link on the live site.

![New page button added to a page](https://docs.kentico.com/docsassets/k81/example-publishing-community-news/new_page_button.png "New page button added to a page")

## Adding the editing support

Add the **Edit contribution** web part to the Community news page. Set the following properties:

- **Show for page types:** cms.news _–_ this ensures that the web part is displayed only on the news detail page.
- **Allow editing by users:** Page owner –  this ensures that only the creator of the news item can edit or delete the page.

The web part displays the **Edit** and **Delete** buttons when an author opens a news item they wrote.

![Edit page button added to a page](https://docs.kentico.com/docsassets/k81/example-publishing-community-news/edit_page_button.png "Edit page button added to a page")

## Testing the results

1. Open the Users application and click **New user**.
2. Set the following properties:
   - **User name**: test
   - **Full name**: test user
   - **Privilege level**: None
3. Click **OK** to save the user.
4. Switch to the **Sites** tab and assign the user to the Corporate site.
5. Sign out and sign in to the Corporate site as **test**.

On the Community news page, the test user can see and use the New page link. Once you save a new page, the Delete button appears. If you go back to the Community news page and click the newly created news item, you can edit or delete the news item.

## Approval process

To set up an approval process for published news, use [workflow](https://docs.kentico.com/k81/managing-website-content/configuring-the-environment-for-content-editors/configuring-workflows.md) on the particular site section.
