Show only Expanded sub menu

theHuston - December 17, 2008 - 01:41

Whats up Druplers... Ive been working on my first Drupal project, and so far its pretty amazing. Ive had a few run ins that took some head banging to figure out, but thats how learning goes... and i didnt really like that dog anyway.... but...

I have been trying to get my menu block to only display the menu items that are under the current page.. and I dont want any menu items on the home page.

I have a flash header with a menu as my main navigation. So basically I want it when I click a page in my flash menu, that it will pull up the page and a block of the pages created under that page.

(sorry my Drupal child parent lingo sucks, I hope I am somewhat clear on my intentions)

I have tried doing it with CSS and it was getting dirty quick... any better ideas?

Thanks TONS.. any help or suggestions would be greatly appreciated.. and when I get this Drupal all figured out Ill be returning the favor(s).

-theHuston

If you enable book module

gpk - December 17, 2008 - 01:49

If you enable book module and create each of your top level pages as a new "book" then you will automatically have a block available that shows the nav for that book.

However when you are on a child page it will still show parents and siblings as well as any children of its own. If that's not what you want then try http://drupal.org/project/menu_block.

gpk
----
www.alexoria.co.uk

Huh.

theHuston - December 17, 2008 - 02:11

Ill look into that module, thanks buddy.

I forgot that if somthing is "hard" to just find a module. :p

Chris Huston
theHuston.com

yah

dman - December 17, 2008 - 03:22

Menu block allows you to choose your sub menus individually,
but menu_block_split, menu_trim or local_menu (and others?!) will shave off the top of the current context and only show the local 2nd nav and down. This means you can build just one big tree heirarchy and the system will figure out the rest.
http://drupal.org/search/node/type%3Aproject_project+split+menu

I'm not 100% sure of what the difference between implementations is. Mostly in the UI and configs IIRC.

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |

Awesome...... but uh.

theHuston - December 17, 2008 - 08:45

works perfect, exactly what I was looking for.

Only problem is it renders my image node on the bottom of the menu list.

Any ideas how to get it not to?

Again, Heeuuge thanks guys.

Chris Huston
theHuston.com

Where should it be? Can you

gpk - December 17, 2008 - 11:35

Where should it be? Can you post a link to the site?

gpk
----
www.alexoria.co.uk

Well Im localhost

theHuston - December 17, 2008 - 20:12

It currently is local.. but Ill do a screen cap and upload..

http://www.thehuston.com/menuWork.jpg

Under "News and Events" is where my secondary menu block appears. Because the page node has an image node in it, it displays the image node under the menu block.. or in it.. im not sure.

thanks... again.

Chris Huston
theHuston.com

I see what you mean. I

gpk - December 17, 2008 - 22:08

I see what you mean. I wonder if the image node is in the menu tree somehow. If so, remove it. Or configure the menu block to show only the one level or somesuch.

gpk
----
www.alexoria.co.uk

That's freaky, but it can't

dman - December 17, 2008 - 22:20

That's freaky, but it can't be a menu blocks doing.
Isn't that just the image_attach block?
Use firebug to see what the wrappers around the image are called, or check your admin-blocks page.

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |

HEEAAYY! That is what it

theHuston - December 17, 2008 - 22:31

HEEAAYY!

That is what it was.. I never turned the image_attach block on... so I didnt even suspect him.. Sorry, I feel a wee bit soompid now.

This is my first Drupal site, soon Ill stop asking stupid questions.

Thanks for your time though guys, much appriciated.

Chris Huston
theHuston.com

Nah, don't worry about

dman - December 17, 2008 - 23:02

Nah, don't worry about it.
image_attach auto-enables the block on install without telling you :-/ which I find redundant nowadays as it shows up in the body anyway. It may have had a reason to do that a while ago, but that should probably be fixed.

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |

Yes good point menu block

gpk - December 17, 2008 - 22:31

Yes good point menu block should be putting node title and link in the block, not anything else!

gpk
----
www.alexoria.co.uk

How can I get the parent?

theHuston - December 18, 2008 - 08:21

How would I go about putting the title of the parent above the text links... and have the title of the child page in a different spot.

For instance when you click on "Abous Us", you go to the abous us page and see its title above the child links....

then if I click on one of the children, the "about us" stays above the child links.. but a title for "our mission" comes up to the right.. (or in some print() area)

So i guess what Im asking is.. i know about <?php print $title ?>

but is there an <?php print $parentTitle ?>

Just... wondering.. if anyone happens to know..

Thanks for all your guys' help..

-theHuston

Chris Huston
theHuston.com

Okay so I just went looking

theHuston - December 18, 2008 - 08:29

Okay so I just went looking and found...

<?php
  $parent
= node_load( $node->parent );
  echo
$parent->title;
?>

This will solve problems.. but on the pages where "Home" is the parent.. it should just be <?php print $title ?>

So I am thinking..

<?php
  $parent
= node_load( $node->parent );
if((
$parent->title)=="home"){
print
$title;
}else{
  echo
$parent->title;
}
?>

but obviously its not "home"... i think im close though.

or not.. I tried... <?php 

theHuston - December 18, 2008 - 08:44

or not..

I tried...

<?php
  $parent
= node_load( $node->parent );
  echo
$parent->title;
?>

and I got all kinds of errors.. Im using Drupal 5.whathaveyou... I didnt go with 6 because of AMFPHP and Flex application later..

Am a bit confused exactly

gpk - December 18, 2008 - 10:57

Am a bit confused exactly what you are trying to do ... maybe print the $breadcrumb, which should already be available to your page.tpl.php?

gpk
----
www.alexoria.co.uk

 
 

Drupal is a registered trademark of Dries Buytaert.