Bring the parent along to

Ok so had an issue with wanting to show the parents title in the childs seperate navigation in Drupal.

Using menu_block_split module I can achieve splitting the navigation up, but not bringing the title of the parent with it.

In the block tpl file called block-subnav.tpl.php (note: subnav is the region in my drupal template, so may be different for you.) I added a div called subtitle.

My block tpl file looks like this

<div class="subtitle"></div><?php print $block->content ?>

So in my jQuery I added this:



var $linktitle = $("#nav ul.primary-links li.active-trail a").attr("title");

$(".subtitle").append("<h2> " + $linktitle + " </h2> ");

#nav ul.primary-links li.active-trail a

This is the absolute path for the html element I want, so I make that into a variable.

Then using jQuery I use the append() function and insert the title into the code.