Saturday, August 11, 2012

How to create news items and a news list in Drupal

Drupal does not come with an out-of-the-box news content type. You could use a Information or a blog content, but these are not an exact fit for what we want.  Fortunately, it is pretty easy to create your own ‘News’ content type. You probably have your own idea of what a ‘news item’ should be, and how it should display. Techzarinfo professional Drupal Web Development team provides a customer-based web services in Drupal Web Design, Drupal Website Development Chennai etc..
 

Introduction:

Just create a new node type and call it "news". If you do not want users to be able to post news items, configure the permissions accordingly. You will be able to use the views module to configure blocks like you want. You can create a new page with blocks of content even to display your news items however you want, and give the page its own menu item. Here are the features we wanted for news items:

Requirements

•    News items to be their own ‘content type’ so we can create user roles just for posting news items.
•    Latest five news items to show in a block on the first page.
•    Separate ‘news’ page that lists all news items, most recent first, with paging (eg. Show 10 at a time).
•    ‘News’ page should be a Primary menu item
•    List to show date of the item and title of the item, with the title being a link to the full article
•    News items to support ‘teasers’
•    Have an Archive block on the News page to show an archive of news items by month

Summary of Process

Here’s an overview of  how you do it, followed by detailed instructions.
•    Install the Drupal Views contributed module (if you haven’t already done so).
•    Install Drupal Advanced Help module (this provides a great example of using Views to create a block or page that presents lists of information)
•    Create a content type of ‘news’
•    Check the options to add, change or delete own news items for the appropriate users or roles.
•    Create a ‘block’ view to display news items
•    Place the block somewhere on the first page
•    Create a ‘page’ view to display news items.  You choose which Primary menu item you want to use for this page when you create the view.
•    Create an ‘archive’ block view to display archives by cloning the provided Archive view and changing it
•    Place the archive block somewhere on your news page.