Drupal Articles » Drupal home page creation techniques » Methods of creating Drupal home pages » Custom/dynamic front page using CCK, Views, Panels, and (optionally) Nodequeue. » Pulling everything together for your home page with Panels
- With Panels 2 module installed, go to admin/panels/panel-page/add and click on "Flexible". In your case you "could" just use the Single column layout, but the Flexible layout is ideal since you'll be able to easily change and adapt the layout in the future if you need to.
- Type home for both the Panel name and Path, and press Save and Proceed.
- If you prefer your XHTML to be as lean as possible, you should make use of Panels' ability to stack multiple content items inside a single Pane of the panel (this is especially simple in a single column layout like you have). When you have a more complex layout this may not be possible, but in your case it is. So if you'd like, go with Option 1 below for that, or else Option 2 for separate rows (more divs).
- Option 1: Set the Rows option to 1. Change the column title for Row 1 to Home Articles. Ignore Rows 2 and 3 (setting the Rows option above to 1 will cause these extra rows to be deleted when you save this page). Click Save and Proceed.
- Option 2: Leave Row 1 as is. For Row 2 set: 100, 1, empty, empty ... and change the name to just Middle. Leave Row 3 as is (you'll now have a layout with 3 rows in a single column). Click Save and Proceed.
- Nothing needed in the next two screens right now, so press Save and Proceed twice to get to the Content page.
- Note: for the following steps of adding content to the Panel, I suggest that for each you add a custom CSS ID when given the option (e.g. home-top, home-middle, home-bottom). This will make it easy as pie to style each Panel pane with easily recognizable names in your CSS.
- Depending on your choice of Option 1 or 2 above, you now see 1 row (Option1) or 3 rows (Option 2) where you can add content using the + icon. In the Top row, choose to make New Custom Content (which is just basic content added directly into the Panel as opposed to using other preexisting data from the site), and paste in the welcome text and HTML for the home page in the Body.
- In the Middle row, this is where to add the Nodequeue-controlled-View mentioned earlier. It should be listed when you click the Add content + button, since we made it available to Panels module earlier.
- The bottom pane could just be another New Custom Content item if you like, with the image/link HTML pasted in... or you could get more fancy and have another CCK type to hold this image and the correct link to the latest, plus a single item View that always will show the latest item. Another alternative is to embed a node in a Panel, which you might do if you want simple HTML/image but need someone to be able to edit it without allowing them access to Panels module - make a single Page node (or other CCK type), add the content to it, and drop the node into Panels following the steps on the above-referenced link (now a person can update the content of that node and not need to use Panels to do it).
