The icky bit
The next step may seem obvious, but actually it's not. We've got the articles containeri set up, and we know that the news and blog pages are going to be categories. We also know that dynamic content is going to be assigned to the news and blog categories. So are we going to make the obvious move, and create these two categories beneath articles? Is there any reason why we shouldn't?
Let's think about the setup that we end up with if we do this. Because the news and blog pages are both categories in the same container, when the user creates a new news item or blog entry, they'll be asked to select a categoryi from the articles container in which to put them. That is, when a new news item is created, the user must choose to put it in the news or the blog category. The same goes for blog entries. Clearly, this is a ridiculous setup! The user shouldn't be able to make this choice, because news items must always go in news, and likewise for blog entries. What's more, the name articles doesn't even sound right for this kind of categorisation. Wouldn't sections be a more appropriate container name for the categories in question?
To solve this problem, it would be great if we could create two containers in between articles and news / blog, both called sections. That way, each container would only have one category inside it, and so the user would only ever be able to choose one category, when adding a new news item or blog entry. But if we do this, then the whole structure gets messed up! We don't want our breadcrumb trail and menu structures to read home -> articles -> sections -> news; and because we're using the category module, this is not something that we're prepared to compromise on.
Fear not, young Jedi: the answer lies with hidden containeris. If we create these sections containers, and set them to be hidden, then they will do everything we want, but without messing up our category structure at all. They will be there, and they will do their job, but they will effectively be invisible! So, let's do it - let's unleash the magic of hidden containers on our site.
Go to the articles container on your site, and click the add child container link. Call your new container sections, then go down to the container information box. In the admin title field, type in sections (blog). The admin title field is useful when you need to create multiple containers with the same title, as it allows you to still differentiate between those containers in the administrative interface. For the types field, tick the blog node type. Set the hierarchyi field to single, and tick the required check box. Set the hidden container field to enabled.
In category display settings, set show prev, next, and up links to enabled (within this container). Tick auto-display TOC within this container, as well as show message if no posts. Next, down to the category menu settings box. Set menu items within this container to enabled, and set menu items for assigned nodeis to enabled (but disable each item). This creates menu items, but makes them visible only in your site's breadcrumbs - disabled menu items are not shown in any navigation blocks. This is very handy for assigned nodes, but isn't commonly used for categories and containers themselves.
Create the first sections container, then repeat the whole process again - following exactly the same steps, except that for the admin title field, type in sections (news), and under types, tick story instead of blog - thereby creating an (almost) identical second sections container. Phew - you're through the tricky bit, hope you didn't get too muddy!
Stupid question: why we can
Do we need to set the Parent field?
After following these instructions (using Drupal 4.7.2) and looking at what I had using:
administer->categories
I noticed in column 3 that all 3 of my containeris listed Parents as "None"
So I clicked Edit container for Sections (blog) and I found that in the "Container Information" area there is a drop down field labeled "Parent:*" and it was set to .
This didn't seem correct. So I changed it to "Articles*".
Then I did the same for Sections (news).
Was this the correct thing for me to do? If so, you might want to add that step to your instructions above.
Thanks,
James Grove
www.jamesgrove.com
Missing one small but important step
bug in "add child container"
in the instructions above it states "Go to the articles containeri on your site, and click the add child container link"
however, when you click on the link, and go to the "categoryi information" section the value for "Parent" is "root", logically is should have been "Articles".
i'm trying this tutorial out on drupal 4.7.0 and category module 4.7.0.
yashesh bhatia.
Tutorial option not reflected in demo
This instruction can't be carried out on the demo:
"For the types field, tick the blog node type."
There is no blog node type in the demo.
Jeff