Hi,
I've searched all over, and tried code snippets etc., but I just cannot get this to work!
I have just added a FAQ section to the company website (running drupal 5.2 at www.rapitasystems.com). I have created a 'content type' (FAQ entry) which contains each FAQ. I have written a PHP page (/faqlist) which allows FAQs to be shown as a list (either all, or a particular section). This FAQ page has a left-menu entry, which is fine and works as required.
Now, the tricky bit :-) When someone clicks on *any* FAQ, I would like the left-menu to remain expanded at 'FAQ'. I have managed to get the breadcrumb sorted out (by writing a template: node-faq-tpl.php) but although the documentation I have read implies that the menu entry should be updated, this does not seem to be the case!
The code that I have to create the breadcrumb (in the template file) is as follows:
<?php
$node->breadcrumb[] = array('path' => 'prodserv', 'title' => t('Products and Services'));
$node->breadcrumb[] = array('path' => 'rapitime', 'title' => t('RapiTime'));
$node->breadcrumb[] = array('path' => 'faqlist','title' => t('FAQ'));
$node->breadcrumb[] = array('path' => $node_url,'title' => t('X'));
if ($page) {
menu_set_location($node->breadcrumb);
}
?>but the menu is not set, even though the path appears to be correct! (Incidentally, the 'X' entry into the breadcrumb trail is simply there to ensure that the FAQ part of the breadcrumb displays...)
Does this function not work in a template? Should I take a different approach? Do I need to write a simple 'faq' module to perform this?
As you can tell, I am a little lost :-)
Thanks
Comments
Additional...
The menu I'm trying to add to is not the main 'navigation' menu, but a menu sitting in a block - perhaps this is the problem?
More.
The menu structure I think I need is:
For the FAQ overview:
Product
-FAQ
for individual questions (each of type 'faq')
Product
- FAQ
- - Question
Now, 'Question' in the above tree might simply be literally 'Question', or it might be the title of the faq, I don't mind!
(even) more
It would appear that drupal_set_breadcrumb also works (bu I don't expect that to modify the menu location of course):
in node-faq.tpl.php:
Is what I'm trying to do even possible?!