Panels 2 and Nodequeue 2

7,844 views

Published on

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

Published in: Technology
0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,844
On SlideShare
0
From Embeds
0
Number of Embeds
480
Actions
Shares
0
Downloads
126
Comments
0
Likes
8
Embeds 0
No embeds

No notes for slide

Panels 2 and Nodequeue 2

  1. 1. Panels 2 + Nodequeue 2 Editorial control of content presentation
  2. 2. Objectives <ul><li>Create a simple “news” site </li></ul><ul><li>Create a complex front page that hints at our content </li></ul><ul><li>Create “section” entry pages that lead the user to content </li></ul><ul><li>Control what content is featured on these pages </li></ul><ul><li>http://nodequeue.demo.logrus.com </li></ul>
  3. 6. Basic premise <ul><li>News articles can be any content type </li></ul><ul><li>Control sections by taxonomy </li></ul><ul><li>We’re not worrying about editorial control </li></ul><ul><li>We’re not publishing on a schedule </li></ul>
  4. 7. Why these two modules? <ul><li>Finer layout control than blocks </li></ul><ul><li>Lets each pane know about data on page </li></ul><ul><li>Overrides basic pages </li></ul><ul><li>Pluggable and expandable to handle more objects </li></ul><ul><li>Lets the editor control order </li></ul><ul><li>Lets the editor control length </li></ul><ul><li>Automatically pairs with taxonomy </li></ul>Panels Nodequeue
  5. 8. 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 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.
  6. 9. Featured Stories <ul><li>Story A </li></ul><ul><li>Story B </li></ul><ul><li>Story C </li></ul><ul><li>Story D </li></ul><ul><li>Story E </li></ul>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.
  7. 10. Featured Stories <ul><li>Story B </li></ul><ul><li>Story C </li></ul><ul><li>Story D </li></ul><ul><li>Story E </li></ul><ul><li>Story F </li></ul>When we added Story F to the queue, Story A popped off the front and is no longer a featured story.
  8. 11. Lead Article <ul><li>Story Q </li></ul>The 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.
  9. 12. Queues can be re-ordered
  10. 13. Queues can be re-ordered This is the front of the queue
  11. 14. Queues can be re-ordered And this is the back of the queue
  12. 15. That is, unless this box is checked:
  13. 16. Queues can be re-ordered When reversed, this is the back of the queue.
  14. 17. Smartqueues <ul><li>One queue with many subqueues </li></ul><ul><li>Pluggable system </li></ul><ul><li>Can attach queues to arbitrary data </li></ul><ul><li>All queues have the same basic configuration </li></ul><ul><li>Many queues won’t clog up the UI </li></ul><ul><li>Subqueues are created as needed </li></ul><ul><li>Smartqueue taxonomy: 1 term, 1 subqueue </li></ul>
  15. 18. Your average site Header Left Sidebar Footer Right Sidebar Content
  16. 19. Panels: Content
  17. 20. Now with panels Header Left Sidebar Footer Right Sidebar
  18. 21. Contexts are objects <ul><li>Nodes </li></ul><ul><li>Users </li></ul><ul><li>Taxonomy terms </li></ul><ul><li>Forms </li></ul><ul><li>Any other object someone writes a plugin for </li></ul>
  19. 22. Context source: Arguments http://www.example.com/node/12345 Node: Story XYZ
  20. 23. Context source: Relationships Node: Story XYZ Taxonomy Term Post Author Node: Author Profile
  21. 24. Context at work Header Left Sidebar Footer Right Sidebar Node: Story XYZ Taxonomy Term Post Author Node: Author Profile
  22. 25. Node: Story XYZ node.tpl.php node-panel-foo.tpl.php Attached files CCK Field Group Add comment form

×