News content, pages, and blocks

Add news items to your site.

Overview

  • Create a new content type - news.
  • Create a page called [yoursite]/news. The page shows 10 stories per page with the most recent stories first.
  • Create a block that shows the 10 most recent news (which can be placed in, for example, a sidebar).
  • Create an RSS feed of the 10 most recent news stories.
  • Create a block with a monthly archive of news stories.

Files

The attached ZIP file contains four files decribed here (the names below do not include the version number).

  • news.cck.txt - The news content type. This content type is required for any of the other files to work.
  • news.views.page.txt - The page that shows all of the news stories.
  • news.views.block.recent.txt - The block that lists the 10 most recent news stories. This block also includes the RSS news feed.
  • news.views.block.archive.txt - The block that archives news stories.

Modules required

  • Content creation kit (CCK)
  • Views
  • Views RSS

Installation

These instructions assume you're logged into your site as user/1 (admin).

  1. Download and unzip the file below.

Install the content type

  1. Copy the contents of the news.cck.txt file.
  2. Go to content management > content types > import.
  3. Make sure you're using a plain text editor.
  4. Paste your clipboard into the import data box.
  5. Click the import button.

Install the news page

  1. Copy the contents of the news.views.page.txt file.
  2. Go to site building > views > import.
  3. Make sure you're useing a plain text editor.
  4. Paste your clipboard into the paste view code here box.
  5. Click the import button.

Install the recent items block

  1. Copy the contents of the news.views.block.recent.txt file.
  2. Go to site building > views > import.
  3. Make sure you're useing a plain text editor.
  4. Paste your clipboard into the paste view code here box.
  5. Click the import button.

Install the archived items block

  1. Copy the contents of the news.views.archive.txt file.
  2. Go to site building > views > import.
  3. Make sure you're useing a plain text editor.
  4. Paste your clipboard into the paste view code here box.
  5. Click the import button.

Setting up

If you want your news page to appear in your site's navigation ...

  1. Go to site building > menus > lists menus.
  2. Select the menu that you want the page to appear in.
  3. Click add item.
  4. On the next page, enter 'news' (without the quotation marks) into the path field and pick suitable names for the title and description.
  5. Click the save button.

Make blocks appear in sidebars ...

  1. Go to site building > blocks > list.
  2. Drap and drop the blocks into the areas that you want them to appear.
  3. Click the save blocks button.

Make blocks appear on certian pages

For example, if you want the archive block to only appear on the news page, and want the most recent block to appear on every page except the news page.

  1. Go to site building > blocks > list (if you're not already there).
  2. Click configure next to the block you want to change.
  3. Scroll down to page specific visibility settings and change the settings.

Using the news content type

To create a news story, go to content management > create content > news. Write your story & save it. That's all.

Tips

  • Adding a 'teaser' to your story will save space in RSS feeds and on your news page, whilst the full story will be there when people click on the title.
  • You can add categories to your news (e.g. 'local' and 'national') by using taxonomies. Explaining how is beyond the scope of this page. I might get round to writing a tutorial on that at a later time.
  • You can share the burden of who can add news stories by creating a role of 'reporter'. This is explained in the fbloggs tutorial.

Example

The news content type, news page, recent news block, and news archive block are used on this site. The most recent news block can be seen on the home page. The archive and news page is on the, ummm, news page. (Although at the time of writing we don't have many news stories!)