---
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 sample **Corporate Site**.

## Creating the community news section

1. Open the **Pages** application and **Create a blank page** under the **Examples** page.
2. Name the page _Community news_.
3. Switch to the **Design** tab of the _Community news_ page and add the **Repeater** web part.
4. Set the following properties for the **Repeater** web part.

   - **Web part control ID:** repeaterNews
   - **Page types:** CMS.News
   - **Transformation:** CMS.News.Preview

![Community news section with a repeater](https://docs.kentico.com/docsassets/k10/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 and set the following properties for the web part:

- **Show for page types:** CMS.MenuItem
  - 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
  - Ensures that the users can create only news items under this section.
- **Display list of pages:** clear the check box
  - Ensures that the web part displays only the **New page** link, without displaying the list of pages.
- **Allow editing by users:** Authenticated
  - Ensures that only authenticated users can 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/k10/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 and set the following properties for the web part:

- **Show for page types:** CMS.News
  - Ensures that the web part is displayed only on the news details page.
- **Allow editing by users:** Page owner
  - 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 the author opens a news item they wrote.

![Edit page button added to a page](https://docs.kentico.com/docsassets/k10/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
   - **Assign to website**: yes (Corporate site)
3. **Save** the user.
4. Sign out and sign in to the Corporate Site as **Test**.

On the _Community news_ page, _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/k10/managing-website-content/configuring-the-environment-for-content-editors/configuring-workflows.md) on the particular site section.
