0

We are creating a new site for our online news platform with drupal 7, and want to display al our recent news articles in a news site layout style. (like our local news paper and many other news paper websites (http://www.demorgen.be/)). Until now, the articles were displayed in a list-style-layout, each article below another, but we want to change that...

0

Drupal7's default frontpage is not very configurable. You need to create your own front page in order to have it your way. One of the best way to do this is with the views module.

The general steps are: Create a new view. Add the fields that are relevant to your display (images, titles, etc) then change the homepage of your site to the link of your new view in /admin/config/system/site-information. To be more specific:

  • Go to /admin/structure/views/add
  • Enter a title for your view, choose content, of type (choose the relevant type where your news are stored) and the sort you wish
  • Check create a page
  • Enter a title and a path. Remember this path (could be ex: myfrontpage) as this will be the path you will enter in /admin/config/system/site-information
  • Choose display format as unformatted list of fields and choose number of items to display on your frontpage
  • Click continue & edit, this will allow you to add more fields (such as images, etc) to your view under the 'Fields' section (first column)
  • Save your view
  • Go to /admin/config/system/site-information and enter the path of your view

There's also an example frontpage view available in the disabled views at admin/structure/views. You can enable it instead and work with this one. This one has 'frontpage' as path that you need to enter in /admin/config/system/site-information

Views has a quite steep learning curve but once you start mastering it, it becomes your best Drupal friend :). Here are some excellent tutorials:

Good luck

  • thanks bohemier for your answer... I made a view, and now i have the grid-layout that i want (one article at the top, 4 in a 2*2 grid and 6 articles in two rows and three columns), but can i give the rows & columns a fixed width /heigth ? – Rian Feb 2 '15 at 12:38
  • setting widths and heights would need to be done through css with directives like height: 10em; and width: 50%;. Position your parent container with relative (position: relative) for percent values. – bohemier Feb 3 '15 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.