panels, panels everywhere
TRANSCRIPT
Panels, Panels Everywhere
And not a block in place!
What do I want to do
Re-think how you architect, design and implement a Drupal website.
Typical Drupal Design• Blue areas are regions
• Blocks in regions are unrelated to the content
• Have to use PHP snippets to make blocks context sensitive
• Can only place a block in one region
• All regions always render even when not displayed in page.tpl.php
Header
Left Sideb
ar
Footer
Righ
t Sideb
ar
Content
How Designers See A Page
• Everything on a page is a part of the content of that page, taken within the context of the entire site.
Content
Aw Crap, He’s Showing Us Code
Page.tpl.php
Workflow
• Requirements
• Architecture + Wireframes
• Comps
• Implementation
Page Manager
• Don’t just decorate what the site gives you.
• Do not let the page own the content, let the content own the page.
• List all your pages, or at least the page templates, in one place.
• Let your pages show what they want to show based upon things like content type, user access levels, current language, etc.
Create a page
• Decide where it lives.
– In Drupal, the URL controls the hierarchy. i.e, /members/admin is automatically under /members.
• Decide what its context is.
• Decide what content it displays.
You keep using that word. I do not think it means what you think it means.
• Pronunciation: \ k̍än- t̍ekst\• Function: noun• Etymology: Middle English, weaving together of words, from Latin
contextus connection of words, coherence, from contexere to weave together, from com- + texere to weave — more at technical
• Date: circa 1568• 1 : the parts of a discourse that surround a word or passage and can
throw light on its meaning2 : the interrelated conditions in which something exists or occurs :environment, setting <the historical context of the war>
• — con·text·less \- t̍ekst-ləs\ adjective• — con·tex·tu·al \kän- t̍eks-chə-wəl, kən-, -chəl, -chü-əl\ adjective• — con·tex·tu·al·ly adverb
Context in the sense of a Page
• All the data objects that you need in order to generate the content to display:
– Node
– User
– Language
– Taxonomy Term
– Forum
– Organic Group
Where do Contexts Come From?
• Arguments– /taxonomy/term/%term
– /forum/%forum
– /music/beatles/the-white-album/hey-jude
• Other contexts– Node author
– Node reference
• They just are
Why is this important?
• When you add a piece of content to a Page Manager Page, you can tell it which context it cares about.
• Node views need a node context.
• User profiles need a user context.
• Forum listings need a forum context.
• Views can accept contexts too!
Variants: Do You See What I See?
• Authenticated users need a richer experience?
• Local users should see more Local content on the front page?
• Separation of pages is not necessarily by path?
– As far as Drupal is concerned, all /node/% URLs are handled the same way. i.e, /node/2 and /node/3 use the same rendering mechanism. But my wireframes don't agree.