Is there a way to include a spacer in a block? My navigation block is getting a little long, and I would just like to break it with a line going across it. I dont want to start a new block as it all relates to the one thing. Is this possible?

On a side note, can you include a block within a block?

Comments

gerd riesselmann’s picture

Since the menu is themable, it should be possible to generate a menu where each item has a special id assigned by overloading the according functions in your theme. These ids can be triggered by CSS to draw a line.

Look at the theme_menu_* functions in menu.inc to pick the ones to overload in your theme. theme_menu_item looks promising.

Out of the blue:

function mytheme_menu_item($mid, $children = '', $leaf = TRUE) {
  return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'" id="menuitem-' . $mid . '">'. 
           menu_item_link($mid) . $children ."</li>\n";
}

This should generate menu items like this:

<li class="collapsed" id="menuitem-1">...stripped...</li>
<li class="collapsed" id="menuitem-2">...snipp...</li>
<li class="collapsed" id="menuitem-3">...thrown away...</li>

Now, if you want to draw a red line between item 2 and 3 and give it a little more space, use this CSS:

#menuitem-3 {
  padding-top: 0.5em;
  margin-top: 0.5em;
  border-top: 1px solid red;
  }

------------------
Gerd Riesselmann
www.gerd-riesselmann.net

madivad’s picture

You're absolutely gifted. Thanks for that.

somnathsshenoy’s picture

Hi.. The logic looks to be good. But can you please tell me in which file to add php code & which file to add css??

stutibhavsar’s picture

Hi! According to your requirement, you can use "menu html" module. this will assign unique class to each item in the menu. so you can manage your css using those unique class.