Friday, September 11, 2009

Creating a new front page with Views and Panels 3


When you have tools as useful as Views and Panels 3, you'll want to be able to use them together. To figure out how to use them together, let's create a new front page. Drupal's standard front page is useful, but we want something a little more. Please note that the screenshots are from Panels 2, but are similar to Panels 3.

  1. The first thing to do is make sure you have both Views and Panels 3 installed. You don't need all of the Panels modules, but it's easiest to enable them all at once.
  2. The next step is to create the views we'll need. The first one we need, the front page view, is a sample view that comes with Views. Let's enable that.
  3. Click Views (Site Building > Views). This brings you to the Views management page. On the bottom, under the 'Default Views' heading, find the 'frontpage' default view, and click 'Add'. Note that this screenshot is for Views 1; the Views 2 screen is different, but the frontpage view is still available.
  4. Click 'Save' at the bottom.
  5. Views 2 has an 'archive' view provided by default. Simply enable it.
  6. Click 'Save' at the bottom.
  7. Now, on to the panel. Before we can create the panel, you need to make sure Panels can "see" the content you've created. Click the 'Settings' tab at the top. (Administer > Site Building > Panels > Settings > Panel pages)
  8. Make sure everything under the 'New content behavior' heading is checked, especially the checkboxes next to 'New All Views' and 'New Views Panes
  9. Save.
  10. Now, to create the panel. Click Panel pages (Administer > Site Building > Panels > Panel Page).
  11. Set the Name to: front_page
  12. Set the Administrative title to: Home
  13. Set the Path to: front (Alternately, you can check the "Make this your home site page" checkbox.)
  14. Click 'Continue' at the bottom.
  15. Let's select the 'Flexible' layout, which allows us to create our own layout.
  16. Click Continue.
  17. The 'Layout settings' tab that you are brought to looks intimidating, but we're just making a couple changes. One of the benefits of selecting a flexible layout is being able to easily manipulate your panel to have any kind of configuration.
  18. Now, we want some custom dimensions for the panel, so we'll need to invole the Layout designer. Click the "Show Layout designer" button.
  19. In the Region menu, select Region settings, and change the region title to "Left".
  20. Move up a 'box' to the row. In the Row menu, select "Add region to right". Title this region "Right".
  21. Use the slider bar to set the width to 80 on the left, 20 on the right.
  22. Click Finish.
  23. Now we need to add a menu item. Click the 'Menu' tab on the left.
  24. Click the checkbox next to 'Normal menu entry'.
  25. Set the Weight to: -10 and the Title to 'Home'.
  26. Click 'Update' at the bottom.
  27. Click the 'Content' tab on the left.
  28. Click the gear icon in the left pane.
  29. Under the 'Views' heading, find and select the 'frontpage' view we added earlier.
  30. Select the display you wish to use (try page if it's available.)
  31. Click Continue.
  32. Click the checkbox next to 'Link title to view'.
  33. Click the checkbox next to 'Provide a "more" link that links to the view'.
  34. Click 'Finish' at the bottom.
  35. Click the gear icon in the right pane.
  36. Under the 'Activity' heading, find and select 'Who's new'.
  37. Click 'Finish' at the bottom.
  38. Click the gear icon in the right pane.
  39. Under the 'Activity' heading, find and select 'Who's online'.
  40. Click 'Finish' at the bottom.
  41. Click the gear icon in the right pane.
  42. Under the 'Views' heading, find and select 'archive'. Use the block display.
  43. lick Continue
  44. Click the checkbox next to 'Link title to view'.
  45. Click 'Finish' at the bottom.
  46. Click the gear icon in the right pane.
  47. Under the 'Activity' heading, find and select 'Recent comments'.
  48. Click 'Finish' at the bottom.
  49. Click 'Save' at the bottom.
  50. Now, one last thing to do; we still have to make our front page the front page. Go to the 'Site information' menu (Administer > Site configuration > Site information).
  51. Set the Default front page to: front
  52. Click 'Save configuration' at the bottom.
  53. Click the 'Home' menu item we added on the menu.
  54. Voila, we have overriden the front page with a panel!


Post a Comment


Web Design Company karimnagar, Web Designing warangal, Logo Design Company nizamabad, Indian Website Design Company,