I've got drupal set up and seem to have a basic grasp on the whole thing, but I'm running into an issue. I've got the main part of the template using the story node, which is all well and good. But I want to put a couple things on the side bar. One of them is a static "who we are" sort of thing, which seems that it should be either a Box or an HTML Block.
I also want to a dynamic list of frequently asked questions. Since there are multiple frequently asked questions, this seem like it ought to be a node (basically a clone of the story module), but the design of drupal seems to indicate that the side bar is the "blocks" section, sorting each of the blocks by weight. So do I make it a block instead of a node? If so, how do I replicate the node functionality of allowing multiple items to show up, one after the other? There is the option of a PHP block, but how do you make it behave like a node? The only documentation I can find about PHP blocks is that you can put PHP in a PHP block. Can you put drupal hooks in a PHP block? Is that the answer?
I hope this question makes sense, because it is a basic lack of me grasping the drupal tao, I think.
Thanks
Comments
FAQ
I think you might be able to pull this off using the book module. Simply create a FAQ book, and make each FAQ a page in the book. Using the book module, you can categorize your FAQs into sections, generate listings, and so on. The book module in Drupal HEAD also exports a book navigation block which can be used to navigate the FAQs. See the 'Maintaining a FAQ using a collaborative book' section of the book module documentation for more information.
Either way, FAQs should be nodes. If the book module approach does not suit your needs, you'll want to create a new node module. To show FAQs in a sidebar, make your module export one or more blocks. To show a listing of all FAQs, make your module export one.
Book module as a FAQ
I use the book.module for a FAQ myself. I did hack the code slightly to have the "book" link that gets built to read "FAQs", other than that, I used the module as it is. It works pretty well all things considered. My biggest gripe is lack of granular security controls to define sections of the FAQ that certain content editors have control over, but can't muck with other ares. I understand that granular security is something on the road map, and may be available in 4.4.0?
If you're interested, check out my FAQ, built on Drupal 4.2.0 and the book.module at http://www.pdxAdventureRacer.com/ar101.
there's a few modules that wi
there's a few modules that will allow you to place your custom links on the sidebar. these modules work with a given taxonomy, and you could easily set up a vocabulary containing terms such as "who we are" and "contact us" etc., etc.
one that comes to mind is the "menu" module: http://drupal.org/project/menus. though "taxonomy menu" performs a similar funtion: http://drupal.org/node/view/3724. i use the menus module to create a "quick links" sidebar-block at a site i recently created: http://www.avi.org
as far your FAQ, that's an easy one: make your FAQ a drupal book, with each question in your FAQ as a page title, and each answer as the page. this way, the user can browse your "book" by "question", clicking on the appropriate question (title) to reach the correct answer (page). there's also an example of that at http://www.avi.org (e.g., "where can i get help?").
regarding php blocks/nodes: there's little documentation on them (i reckon) because they're totally straighforward! there's only two things to keep in mind, however: when creating PHP content, remember to leave out the opening/closing tags; e.g., the <? and the > tags.... and make sure you return your output, not print it directly.
Got sample code for book-in-a-block?
The book-in-a-block at the http://www.avi.org site is exactly what I've been seeking for my internal site.
Do you know where I can get a sample of code to do it? I don't know PHP, but I know enough about programming to edit existing code. I was unable to find sample code in the online help or this forum.
Just in case my terminology is inaccurate...I know how to create books and blocks in Drupal. I have PHP code to put a story in a block. I'm seeking PHP code to put a book in a block.
(I've also sent email to the AVI site, to cover all the bases.)
Thank you in advance for any assistance and your patience with a newbie.
Maribeth Ahne
maribeth@lexmark.com
Menus
Jhriggs' excellent menu module allowed me to create the "book-in-a-block" menu system at avi.org.
http://drupal.org/project/menus