introduction to drupal 7 - panels
DESCRIPTION
Lecture on using the Panels module and making the home page.TRANSCRIPT
Introduction to Drupal 7
Session 6.1
Panels
1Course by Init Lab (http://initlab.org)Drupalist: Kalin Chernev
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
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
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
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
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
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
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
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
Your new layout
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 10
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
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
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
Your new home page with panels
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 14
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
Home page panel feature
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 16
Time for questions
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 17
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