Skip to end of metadata
Go to start of metadata
Icon

What is the news module?

The news module allows you to create individual news items using a special template, and then insert a short summary of news items anywhere on your site.  You can also 'tag' (categorise) news items so as to restrict what news gets included where.

How to add, edit and expire news items

How to include news items on pages using macros

{{news}}

list all news items in descending chronological order from a 'news' subfolder relative to the current page

{{news:items=3}}

list the 3 most recent news items in descending chronological order from a 'news' subfolder relative to the current page

{{news:tag=tagtext}}

display only news articles which contain a particular tag.  Multiple tags should be comma separated.

{{news:type=small}}

display only a list of titles as links to the full article. Useful for right hand columns

{{news:type=smalldate}}

as with small but also displays the date

{{news:type=nodate}}

display title and teaser. Useful if article doesn't relate to a date or if a different date appears in the article

{{news:path=/bucs/news/}}

change the location of the news articles. By default a news folder at the root of the site folder is used

{{news:items=5:type=nodate}}

list the 5 most recent news items in descending chronological order from a 'news' subfolder relative to the current page and display only the title and the teaser

{{news:order=asc}}

Change the date order of the articles to ascending (earliest first - this is useful for lists of events). By default, the system uses descending date order (most recent first). 

{{news:display=monthly}}

Display the articles split into separate months 

{{news:display=weekly}}

Display the articles split into separate weeks 

{{news:timeframe=currentmonth}}

Display only the articles for the current month 

{{news:timeframe=currentweek}}

Display only the articles for the current calendar week (starting on a Monday) 

{{news:timeframe=currentday}}

Display only the articles for the current day 

{{news:timeframe=previousmonths}}

Display only the articles for the previous months (excluding current month) 

{{news:timeframe=previousweeks}}

Display only the articles for the previous calendar weeks (starting on a Monday; excluding current week) 

{{news:timeframe=previousdays}}

Display only the articles for the previous days (excluding today) 

{{news:timeframe=last7days}}

Display only the articles for the last 7 days (counting backwards from today) 

{{news:timeframe=beforelast7days}}

Display only the articles for the previous days (counting backwards from today minus 7 days) 

How to use tags to categorise news items and display them in context around your site

Example: you have a seminars page, a  general news page, and a PhD studentships page.  You want to display the studentships and the seminars on their respective pages, but not in the news feed on your homepage.

In this case, you tag your seminar announcements with the tag seminars (but store them in the news folder).  Then you add the macro {{news:tag=seminars}} to the seminars page.

Similarly, you tag your general news items with the tag news, then add the macro {{news:items=5:tag=news:type=small}} to the right-hand column of your homepage, and the macro {{news:tag=news}} on the news homepage.

Finally, you tag your PhD studentship announcements with the tag phdstudentships, then add the macro {{news:tag=phdstudentships}} to the PhD studentships announcements page.

Using RSS feeds to promote your site's news

In the example above, it may be that you don't have any PhD studentships to be advertised at the moment, but you do want to encourage visitors to subscribe to that category of news in order to find out when you are offering them.  In this case, it is useful to create an RSS feed (a syndicated summary of a news site that can be viewed in an RSS reader or included in another webpage).

If you would like an RSS feed for your news page, please contact Web Services (web-support@bath.ac.uk) with the URL of the relevant page and/or the tag and we will set one up for you.

Unable to render {include} The included page could not be found.

Macros in context

1 Comment

  1. Unknown User (ma1twn)

    I really don't understand the final diagram...