icon News
Created by Orckestra

Show technical information

How to add News to your website

The package comes with a page type "News page" you can create a page with. It will add the news feature to the page automatically:

  1. Create a page.
  2. Select "News page" for its Page type.

This will add the "News" application and the "Composite.News.NewsList" and "Composite.News.NewsLatest" functions to the page.

Note: This requires that the layout template the page is using has two placeholders with these IDs:

  • 'content' ( for the Composite.News.NewsList function)
  • 'aside' (for the Composite.News.NewsTeasers function)

Otherwise, consider adding the news-related functionality to pages manually as described below.

How to add the News application manually

  1. Right-click the page you will use to store news under.
  2. Click Add Application.
  3. In the Add Application window, select "News" in the Application drop-down list.
  4. Click Finish.

How to add the News List manually

  1. Edit the page where you have added the "News" application.
  2. On the Content tab, insert the Composite.News.NewsList function ( Insert > Function), or add the following code:
    Expand code
  3. If needed, set these optional parameters:
    • List options: Additional data to show when displaying news items in a list, such as the date, teaser, description, RSS link. (By default the date and the teaser are displayed.)
    • Item options: Additional data to show when displaying a single news item, such as the date, teaser, news story, share icons, "Back to News" link. (All the options but "teaser" are displayed by default.)
    • Page Size: The number of items to display on the page ("10" by default).

How to add the News Latest manually

  1. Create or edit the page the latest news will appear on (for example, the front page of the website).
  2. On the Content tab of the page for the latest news, insert the Composite.News.NewsLatest function ( Insert > Function), or add the following code:
    Expand code
  3. (Optionally) Set these parameters:
    • Count: The number of items to display on the page ("5" by default).

Note: If you have more than one news list on the website, the latest news from all the lists will be displayed here.

How to add and publish news

  1. Expand the "news" page and select News.
  2. Click Add News on the toolbar.
  3. On the Settings tab, fill out these fields:
    • Title: The title of the news item
    • Date: The date of the news item
    • Teaser: The short description of the news item
  4. On the Description tab, write content for the news item.
  5. Click Save and click Publish.

How to implement typical RSS feed functionality

To access the RSS feed of the news on the website, use the following URL:

http://<HostName>/NewsRssFeed.ashx/<culture>

where <culture> stands for the culture code (such as "en-US") used on your site. For example,

http://www.contoso.com/NewsRssFeed.ashx/en-US

To enable localization of the news:

  1. In the Data perspective, select the Composite.News.NewsItem page datafolder.
  2. Click Enable Localization on the toolbar.
  3. Follow the wizard.

Customization

To customize Composite.News, edit its Razor functions:

  • Composite.News.NewsList
  • Composite.News.NewsLatest

You can also create a separate stylesheet and link to it from these Razor functions, for example:
Expand code

Important Notes

  1. The Composite.News.NewsList function should be only added on the page where the "News" application has been added.
  2. Only published news items will be displayed on the page.