introduction to drupal 7 - panels

18
Introduction to Drupal 7 Session 6.1 Panels 1 Course by Init Lab (http://initlab.org) Drupalist: Kalin Chernev

Upload: kalin-chernev

Post on 14-Jan-2015

9.190 views

Category:

Technology


2 download

DESCRIPTION

Lecture on using the Panels module and making the home page.

TRANSCRIPT

Page 1: Introduction to Drupal 7 - Panels

Introduction to Drupal 7

Session 6.1

Panels

1Course by Init Lab (http://initlab.org)Drupalist: Kalin Chernev

Page 2: Introduction to Drupal 7 - Panels

Agenda

• What is Panels and when to use

• Common uses – home page

• Administration overviews

• Case study – making the home page

2Course by Init Lab (http://initlab.org)Drupalist: Kalin Chernev

Page 3: Introduction to Drupal 7 - Panels

Panels

• Another very popular module in the category of Views and Chaos Tools

• It makes website builders’ lives easier, making it possible to configure blocks in different layouts with drag and drop

• Panels are good to use when you have blocks which need to take contextual information

• Panels are also good for starters, as they give lots of options for styling and layout configurations

• Panels is well integrated with Views and OG• Can be exported in Features

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 3

Page 4: Introduction to Drupal 7 - Panels

Panels notes

• If you’re good front-end developer, you might want to avoid panels – they generate a lot of markup

• If you’re good developer, you might also want to avoid using panels, as they tend to make more unneeded queries and make not so good performance as without panels

• If you don’t need contextual information in blocks, and you’re good with blocks management, try using regions instead of panels

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 4

Page 5: Introduction to Drupal 7 - Panels

Creating your home page

• Download and install Panels module• Turn on the Panels and the Panels in-place editor• Turn on the Pages Manager too to manage the Panels Pages

through an UI• Click “Create a new page”

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 5

Page 6: Introduction to Drupal 7 - Panels

Creating your home page

• Administrative title: Home page• Machine name: home_page• Path: /home• Leave the rest in default configurations and go on• Select Flexible Builders from Builders category

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 6

Page 7: Introduction to Drupal 7 - Panels

Creating your home page

• Administrative title for the variant: Home page• Renderer: In-Place Editor• Title type: No title• Click Finish and we’ll edit the panel after that

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 7

Page 8: Introduction to Drupal 7 - Panels

Creating your home page

• We want to split the panel into 3 regions: 1 top and 2 underneath• So, we click on Show layout designer to be able to edit the layout• On the Column, click to add a row to the bottom• Use the Regions option

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 8

Page 9: Introduction to Drupal 7 - Panels

Creating your home page

• On the new Row click and select to add a new region

• Name the region Left and set it to be Fluid width

• Repeat the step to add a Right region to the right

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 9

Page 10: Introduction to Drupal 7 - Panels

Your new layout

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 10

Page 11: Introduction to Drupal 7 - Panels

Placing content in the regions

• Click on the small wheel and click Add content

• Select a block of your choice, i.e. Welcome to the website custom block

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 11

Page 12: Introduction to Drupal 7 - Panels

Placing content in the regions

• Repeat the steps for the other 2 regions

• Place the views block for latest news

• Place other (custom) block of your choice

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 12

Page 13: Introduction to Drupal 7 - Panels

Few tweaks on your home page

• There will some left blocks on your home page you might not need any more

– The navigation menu block

– The manually turned on block for latest news

– You can turn them off now

• Go to admin/config/system/site-information

• Set default front page value to ‘home’ (this is the path we have to our panel)

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 13

Page 14: Introduction to Drupal 7 - Panels

Your new home page with panels

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 14

Page 15: Introduction to Drupal 7 - Panels

Saving your work into a feature

• Go to admin/structure/features/create

• Enter a name for the feature, i.e. Home page panels

• Enter a description, i.e. 2 custom blocks and 1 view block for home page

• From the components, select Page manager: page_manager_pages to see your panel page, select the Home page panel page

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 15

Page 16: Introduction to Drupal 7 - Panels

Home page panel feature

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 16

Page 17: Introduction to Drupal 7 - Panels

Time for questions

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 17

Page 18: Introduction to Drupal 7 - Panels

Contacts

Kalin Chernev

– E: [email protected]

– T: twitter.com/kalinchernev

– U: http://shtrak.eu/kalata

Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 18