My secondary links are: My Account, My Inbox (I have the privatemsg module installed), My Subscriptions, Recent posts, administer (when logged in as admin) and Log out. Where is the block that I can enable?
I happen to be working on that as well. I have the primary and secondary links set to the same menu, so when a primary menu item is activated, the child menu items will show up as secondary links. Right now the secondary links are rendered in page.tpl.php, but I want to put them in a block.
The php code in my template (based on Zen) to produce the secondary links is:
I just put that code in a new block and published it, but that didn't work. Next I tried adding <?php echo "sl = $secondary_links";?> and <?php print_r($secondary_links);?> to the block, but the block remained empty. Obviously, the $secondary_links variable isn't available here. If anyone knows how to solve this, please tell us. If I figure it out myself, I'll let you know.
I found it! api.drupal.org to the rescue!
On http://api.drupal.org/api/function/phptemplate_page/5 I found the function which prepares the variables for page.tpl.php. As it turns out, there is a simple function which returns the $secondary_links array. So, you can just start your secondary links block with calling this function. My block code now looks like this:
I don't know, do you expect me to go and figure it out and then present the results to you on a silver tray?
Come on, you can do better than this. Have you actually tried to just use the D5 code? Tell us what you tried so far, what the output was, if you got any error messages, which relevant documentation you have found, what you think might be the problem...
um, well, maybe not a silver tray but platinum, you bet and use gold for the trim :)
I did try the code and it didn't work ? I wouldn't have posted, if it did (knocking on wood), I no longer need it, I did away with the page coded menu and done all through the menu blocks.
Comments
It depends
If your seconday links are different than your primary links there will be a block you can enable.
My secondary links are: My
My secondary links are: My Account, My Inbox (I have the privatemsg module installed), My Subscriptions, Recent posts, administer (when logged in as admin) and Log out. Where is the block that I can enable?
Have you made a menu from those links?
Have you made a menu from those links?
Under "Administer" > "Site building" > "Menus"
You would need to add a new menu with these links
Under "Administer" > "Site building" > "Blocks"
Enable the new block for the menu
Working on that too
Hi,
I happen to be working on that as well. I have the primary and secondary links set to the same menu, so when a primary menu item is activated, the child menu items will show up as secondary links. Right now the secondary links are rendered in page.tpl.php, but I want to put them in a block.
The php code in my template (based on Zen) to produce the secondary links is:
I just put that code in a new block and published it, but that didn't work. Next I tried adding
<?php echo "sl = $secondary_links";?>and<?php print_r($secondary_links);?>to the block, but the block remained empty. Obviously, the $secondary_links variable isn't available here. If anyone knows how to solve this, please tell us. If I figure it out myself, I'll let you know.Add this line before your snippet
Add this line before your snippet
Found it!
I found it! api.drupal.org to the rescue!
On http://api.drupal.org/api/function/phptemplate_page/5 I found the function which prepares the variables for page.tpl.php. As it turns out, there is a simple function which returns the $secondary_links array. So, you can just start your secondary links block with calling this function. My block code now looks like this:
It works like a charm (Drupal 5.7).
[edit]LOL, while I was typing my solution, it was also given by nevets... Thanks for helping, I'm glad we agree :-)[/edit]
How to set this up in drupal
How to set this up in drupal 6 ?
I don't know, do you expect
I don't know, do you expect me to go and figure it out and then present the results to you on a silver tray?
Come on, you can do better than this. Have you actually tried to just use the D5 code? Tell us what you tried so far, what the output was, if you got any error messages, which relevant documentation you have found, what you think might be the problem...
um, well, maybe not a silver
um, well, maybe not a silver tray but platinum, you bet and use gold for the trim :)
I did try the code and it didn't work ? I wouldn't have posted, if it did (knocking on wood), I no longer need it, I did away with the page coded menu and done all through the menu blocks.
OK, good for you that you
OK, good for you that you found another solution, my point is, it's hard to help you if you provide so little information.
worked for me using the
worked for me using the clean theme in drupal 6.6 by throwing this snippet in a block
Works great for me also.
Works great for me also. There is just another thing I would like to do: get the 'secondary links' 'father' as a title:
Any ideas? I have tried using menu_get_active_trail(), but it doesn't give me the 'father'. It returns an array like this:
[0] - Home
[1] - Node_i_am_currently_viewing
but my primary links structure is:
- A
- B (I try to print out this as h2)
-- b1 (I am here)
-- b2
- C
Thx
Not nice, but works for
Not nice, but works for now:
FINALLY THANKS ALOT
FINALLY THANKS ALOT