Panels 2 and Nodequeue 2

Preview:

DESCRIPTION

Building a Drupal-based news site with Panels 2 and Nodequeue 2

Citation preview

Panels 2 + Nodequeue 2

Editorial control of content presentation

Objectives

• Create a simple “news” site• Create a complex front page that hints at our

content• Create “section” entry pages that lead the

user to content• Control what content is featured on these

pages• http://nodequeue.demo.logrus.com

Basic premise

• News articles can be any content type• Control sections by taxonomy• We’re not worrying about editorial control• We’re not publishing on a schedule

Why these two modules?

• Finer layout control than blocks

• Lets each pane know about data on page

• Overrides basic pages• Pluggable and

expandable to handle more objects

• Lets the editor control order

• Lets the editor control length

• Automatically pairs with taxonomy

Panels Nodequeue

What’s a queue?

5 4 3 2 1

This end of the queue is the Tail or Back

This end of the queue is the Tail or Back

This end of the queue is the

Head or Front

This end of the queue is the

Head or Front

New items are inserted at the tail of

the queue. If a queue has a

maximum size, the front of the queue is

popped off.

New items are inserted at the tail of

the queue. If a queue has a

maximum size, the front of the queue is

popped off.

Featured Stories

1. Story A2. Story B3. Story C4. Story D5. Story E

Featured stories is a nodequeue with a maximum queue size of 5. Story A was

added first and is currently at the front of the queue. Story E was just added and is now

at the back of the queue.

Featured Stories

1. Story B2. Story C3. Story D4. Story E5. Story F

When we added Story F to the queue, Story A

popped off the front and is no longer a featured

story.

Lead Article

1. Story QThe Lead Article queue has a maximum size of one. Every time a new lead article is added to the queue, the former lead article is popped out, meaning there is

only ever one lead article at a time.

Queues can be re-ordered

Queues can be re-ordered

This is the front of the queue

Queues can be re-ordered

And this is the back of the

queue

That is, unless this box is checked:

Queues can be re-ordered

When reversed, this is the back of the queue.

Smartqueues

• One queue with many subqueues• Pluggable system• Can attach queues to arbitrary data• All queues have the same basic configuration• Many queues won’t clog up the UI• Subqueues are created as needed• Smartqueue taxonomy: 1 term, 1 subqueue

Your average siteHeader

Left Sidebar

Footer

Right Sidebar

Content

Panels: Content

Now with panelsHeader

Left Sidebar

Footer

Right Sidebar

Contexts are objects

• Nodes• Users• Taxonomy terms• Forms• Any other object someone writes a plugin for

Context source: Arguments

http://www.example.com/node/12345

Node: Story XYZ

Context source: Relationships

Node: Story XYZ

Taxonomy Term

Post Author

Node: Author Profile

Context at workHeader

Left Sidebar

Footer

Right Sidebar

Node: Story XYZ

Taxonomy Term

Post Author

Node: Author Profile

Node: Story XYZnode.tpl.php

node-panel-foo.tpl.php

Attached files

CCK Field Group

Add comment form

Recommended