• No results found

D7 Panels From Zero to Hero Tutorial

N/A
N/A
Protected

Academic year: 2021

Share "D7 Panels From Zero to Hero Tutorial"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)

Joeri Poesen & Salva Molina

DrupalCAMP

jerez de la frontera

SPAIN 2015

D7 Panels


From Zero to Hero in 2000 Seconds

(2)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Topic of this talk:

(3)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Schedule (more or less):

1. Getting started (10 min)


Why Panels? CTools, Pages and Variants, 
 overriding Pages vs Custom Pages.

2. Digging deeper (10 min)


Contexts, Panel nodes, Mini Panels, custom 
 panes, Views content panes.

3. More advanced Panels stuff (10 min)


Panels Everywhere, Semantic Panels, 


(4)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Intended audience:

1. New site builders with no Panels experience


2. Site builders with some Panels experience, 


eager to see more advanced stuff and custom


code.

(5)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(6)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Still here?

Ok, let’s go.

(7)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

JOERI POESEN

@jpoesen on drupal.org

@jpoesen on twitter

SALVA MOLINA

@slv_ on drupal.org

@salva_bg on twitter

(8)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

http://codeenigma.com

High Availability Drupal hosting Enterprise and Gov consulting Drupal development

Drupal training & team coaching Content Strategy

(9)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

(10)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(11)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Part 1

(12)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

What is this Panels thing

of which you speak?

“A module that allows you to visually create custom, re-usable page layouts with a

(13)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(14)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(15)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(16)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

¡Si, verdad!

Theme regions give a lot of flexibility:

(17)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Sometimes maybe

even a little too much flexibility:

(18)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Some of the limits of the core

regions-and-blocks building approach

• only blocks can be put in

regions


• any given block can only be

placed in one region


• blocks have limited 


display logic / visibility rules


• blocks are not exportable

• tricky to have radically

different layouts in different sections of your site


• blocks interface is not the

most intuitive/easy to use for non-tech users


Panels addresses

(19)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Second reason to use Panels: micro-layouts

• Break apart pages (nodes, forms, search results, …) 


and re-assemble them in a panel without custom template files


• Multiple layouts for the same page, with complex logic to decide

which layout to use:

• Role based

• Device based

• Content-type based

• Content based

(20)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Some core concepts (1/2)Page Manager (part of the CTools module)

• hooks into the menu system

• lets you override the display of things like nodes, users and terms

Each Page consists of one or more Variants


Each Variant has a variant type (panel)


Each Variant can have selection criteria and context settings

Each Panel Variant has a Panel layout with Panel Regions that

(21)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Some core concepts (2/2)

• Panel pages can either 


take up the content area 
 of your theme…


…or bypass all theme 


(22)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

• Create a custom homepage


• Override node/x paths


• Override node/x/edit paths


• Enable easy management UI


for end-users


(23)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(24)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Node Panels

new Content Type ‘Panel’


Each Panel node has its own settings


used for one-off panels

(25)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Mini Panels

Tiny, re-usable panels without a path or 


selection criteria, made available as a block


To be used in the core 


block system or as 


a panel inside 


another panel

(26)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(27)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Views Content Pane Displays

make result of a view available as a Panel pane


optionally pass Panel context info to the 


View Display’s Contextual Filter


optionally make some of the View Display’s settings


available in the Panel pane’s settings

demo

(28)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(29)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(30)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Semantic Panels / Planer

a CTools style plugin that gives you full control 


over the HTML output of Panels panes:

Individually add/remove the

HTML element

CSS Classes

Other attributes


(31)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

(32)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

Joeri Poesen & Salva Molina

Custom Panel plugins

on-demand “blocks”

per-instance block settings

isolated “block” code per section

(33)

DrupalCAMP

jerez de la frontera

SPAIN 2015

#DrupalcampSpain2015

References

Related documents

q Web Interface for registrars who can: • Register names; • List registered names; • Search names; • Renew names; • Send ownership transfer orders to registry; • Send

In the last decades, also the European Union has developed several initiatives and documents in order to encourage a smarter and more sustainable urban

(Zemlju solunskih dobrovoljaca Pavelić je odlučio »pokloniti hrvatskim seljacima«, kako stoji u trećoj točki ove zakonske odredbe. Time je Pavelić podijelio Srbe u NDH na

Nichols work with Iowa and Illinois riverboat deregulation has obvious similarities to this study’s investigation into the impact of gaming taxation rate changes in Illinois and

You ve rify the doma in fa brika m.com in the Office 365 a dmin ce nte r a nd instruct othe r a dministra tors to configure ne w Excha nge Online use rs w ith fa brika m.com a

The objectives of this work are to propose a bimodal measurement approach to obtain objective and subjective data, and their correlation with each other to monitor the sickness level

NOTE Pour la détermination de la résistance de la boucle secondaire (R s = R ct + R b ), R b est la charge résistante assignée qui, dans le cas des transformateurs de courant

Create a directory for the Oracle Inventory on the destination node and, if necessary, change the ownership of all the files in the Oracle Grid Infrastructure home to be owned by