News
Created by Orckestra
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:
- Create a page.
- 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
- Right-click the page you will use to store news under.
- Click Add Application.
- In the Add Application window, select "News" in the Application drop-down list.
- Click Finish.
How to add the News List manually
- Edit the page where you have added the "News" application.
- On the Content tab, insert the Composite.News.NewsList function ( Insert > Function), or add the following code:
Expand code - 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
- Create or edit the page the latest news will appear on (for example, the front page of the website).
- 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 - (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
- Expand the "news" page and select News.
- Click Add News on the toolbar.
- 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
- On the Description tab, write content for the news item.
- 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:
- In the Data perspective, select the Composite.News.NewsItem page datafolder.
- Click Enable Localization on the toolbar.
- 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
- The Composite.News.NewsList function should be only added on the page where the "News" application has been added.
- Only published news items will be displayed on the page.