Site Recipe: Linear Content in Drupal 7
Yesterday I gave you the steps to set up a simple membership Web site using Drupal 7. Today I expand on this example to show you how to add ordered content to your site.
Huge-big caveat: you can also use the Book module (in core) to create content that is consumed in a specific order. With fields now in core you could also extend the Book content type to have extra fields such as file downloads, images, or whatever else you need. Many people will tell you that Book is limited. Sometimes what I think they're really trying to say is, "It's uncool to use core modules." But I'm not entirely sure. In any case, I don't think there's any shame in using the Book module if it meets. If, however, you need to have more flexibility than what Book offers (let's say you actually need a separate content type) please read on!
First, you will need to download and enable the following contributed modules: Views, CTools, Nodequeue. Because we're just starting to build content on the site (i.e. there aren't a lot of pages) we don't need any of the bulk processing tools...at least we don't for this example.
There are a few things that need to work together, so we'll do a bunch of configuring and then magically it will all come together and work. Stick with me.
- First up: we need to choose which content type will available for your queues of content. For example: I used Course Content because I'm building up information for my students. You might have "Instruction Page" or something else.
- Navigate to Structure, Nodequeue. Click on the tab labeled, "Add Nodequeue."
- Enter the title for your Nodequeue (for example: Module 1). Select the folks who can manipulate this queue ('administrator' in my case). And choose the content types that can be added to this queue. You can even choose MULTIPLE types of content if you want. This is definitely different than the Book module. When you've adjusted the default settings, scroll to the bottom and click, "Submit." Your new queue has been created.
- You are now ready to start adding pages to your queue:
- Navigate to a page you'd like to add to your queue (it must have the right content type). (You can also create a new node if you need to.)
- On the page you'd like to add to your queue, there's a new tab across the top: View, Edit, Nodequeue. Click the tab labeled, "Nodequeue."
- In the summary table, click the link labeled, "Add to queue."
You now have one item added to your queue. Repeat this sequence until you have added all of your existing nodes (pages) to the queue you're working on.
- Now it's time to sort your queue into the right order.
- From the admin menu, navigate to Structure, Nodequeues. Next to the queue you'd like to arrange, click "View."
- You will be presented with a list of all nodes in this queue. Use the cross hairs to drag and drop the nodes into the correct sequence.
- When you've achieved the correct sequence, click "Save" at the bottom of the page.
Your node queue is now complete; however, this is just the structure of the content. You still need to create a public view that others can use to consume your nodequeue.
- To create a View for your nodequeue, complete the following steps:
- From the admin menu navigate to Structure, Views. There should be a little piece of magic waiting for you: a completed View for your new nodequeue. Yay! The path is pretty sucktastic though (nodequeue/1).
- To edit the settings for this view, click on the link labeled, "edit." Welcome to Views 3. Isn't it shiny?
- From the left hand side click on the vertical tab labeled, "Page."
- Scroll down to the section labeled, "Page settings."
- Click on the Path link (by default nodequeue/1). An editing box will appear at the bottom of the configuration settings.
- Adjust the path (URL) to suit your needs. Click "Update" to lock in the change.
- Scroll to the bottom of the configuration screen and click, "Save."
You've done the minimum you need to do to make this nodequeue show up on your Web site at a specified URL. It's now up to you to decide what else you want to tinker with. For example: you could add a menu item for this nodequeue, you could add a Header or Footer to the page. Click around. Do some damage. Because if you have to, you can always go back. To undo all of your mucking about, Navigate to Structure, Views. Locate your View and click the button labeled, "Revert."
And that's it! Now you've got structured content on your Drupal 7 membership site.
If you think that was slick, you need to sign up for the Site Building Extravaganza workshop to learn how to make, theme and deploy 12 unique Drupal sites. But hurry, registration closes January 25th.

Comments
26 January, 2011 - 00:36
Benjamin Melançon
Not that the tools you are using aren't a valid choice, but a factual correction about the book module: you can use it to outline any and multiple content types.
26 January, 2011 - 04:58
mdupont
Exactly, in D6 as well as in D7 the Book module is not limited to one content type, you can select the content types availables for books at the page admin/content/book/settings. This is not so obvious though, as one could expect to find it under "Structure" or "Configuration".
27 January, 2011 - 13:34
Heather Ann
I don't use the Book module (D6) because it forces me to publish nodes before I can use them as parents. My colleagues need to edit, tweak, revise, tag, move things around, test the table of contents, etc., before publishing. I love everything else I know about the Book module, but this requirement is an absolute deal-breaker. (See the Issue queue for loooooong arguments about this 'feature'.)
I have used Nodequeue for 2-level publications (e.g. Articles belong to Issues), but I find it less useful for 3+ level books. I need to make rules like "Chapters can be children of Parts but not of other Chapters", and Node Hierarchy (2.x) lets me do that. To my knowledge, Nodequeue isn't set up to handle that.
1 February, 2011 - 12:33
emmajane
Yup, you need to have a structure in place with book.module before you can start throwing things around in a different order. It's *awesome* for what it's good at. But then it falls down in other places. I personally love Book's ability to auto-generate table-of-contents / menu blocks. Nodequeue doesn't do that. Node hierarchy was my first choice (it's a *lovely* module), but at the time there was no D7 release.
Post new comment