Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

18
How To Create How To Create Custom Layouts For Custom Layouts For Panels Module Panels Module

description

 

Transcript of Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Page 1: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

How To Create How To Create Custom Layouts For Custom Layouts For

Panels ModulePanels Module

Page 2: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Gold Sponsor ofDrupalCamp Kyiv 2011

Page 3: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Silver Sponsors ofDrupalCamp Kyiv 2011

Page 4: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Step by step

Panel overview. Panel structure. Creation of custom layout. Use of custom layout. Custom layouts problem.

Page 5: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Panels overview

1. Drag and drop content manager.

2. Customizable templates.

3. Layout visual design .

4. Place content within that layout:

a. Custom blocks

b. Existing node (by title, nid)

c. Miscellaneous (execute php, views)

d. Node (fields, node attributes)

e. Page elements (breadcrumbs, site logo, site name)

Page 6: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Panel structure

1. Layouts.

Administration → structure → panels → settings → panels pages

Page 7: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Panel structure

2. Layouts elements.

Administration → structure → panels → layouts

→ add flexible layout

Page 8: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Panel structure

2. Layouts elements.

Page 9: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Panel structure

2. Layouts elements.

Administration → structure → pages → edit sites tempates → variants → content

Page 10: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Panel structure

3. What we have at html.

The result is a seven nested blocks with The result is a seven nested blocks with standard classes.standard classes.

Page 11: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Create custom layout

1. How to?

layout-name.tpl.phplayout-name.inc

Theme

Layouts

theme.info

Page 12: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Create custom layout

2. theme.info

plugins[panels][layouts] = layoutsplugins[panels][layouts] = layouts

Page 13: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Create custom layout

3. layout-name.inc

Page 14: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Create custom layout

4. layout-name.tpl.php

Page 15: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Use custom layout

Administration → structure → pages → edit site template → variants → template name → layout →

miscellaneous (drop down)

Page 16: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Use of custom layout

1. Drag and drop content manager.

2. Customizable templates.

3. Layout visual design .

4. Place content within that layout:

a. Custom blocks

b. Existing node (by title, nid)

c. Miscellaneous (execute php, views)

d. Node (fields, node attributes)

e. Page elements (breadcrumbs, site logo, site name)

Page 17: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Custom layout problem

1. Functions call (no preprocess_page) Functions call (no preprocess_page)

3. Can not create regions dynamicallyCan not create regions dynamically

4. One *.inc file per layoutOne *.inc file per layout

Page 18: Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011

Thanks You.Thanks You.

My Contacts:

skype: romkacrvromkacrv

email: [email protected]@adyax.com

icq: 264429514