1

I have 4 columns in the footer, and am displaying a different menu in each block(column). I would like to add an image above the menu items for 3 out of 4 menus. What is the best way to do this? Is it possible to add a field to the menu content type as such? If this was possible I could then create a view for each block/column, by pulling in the menu items and images...

What would be the best way to do this?

  • You can create a menu blocks using menu block module and alter the render of block to add the image. – mohit_rocks Jun 21 '13 at 4:50
  • Thank you for that @mohit_rocks What exactly do you mean by "alter the render of block "? – kine456 Jun 21 '13 at 4:59
  • to append the image you can use hook_block_view_alter() function. This hook allows you to modify any data returned by hook_block_view(). api.drupal.org/api/drupal/modules!block!block.api.php/function/… – mohit_rocks Jun 21 '13 at 6:29
  • Are your blocks a menublock creations, or what exactly? – Mołot Jun 21 '13 at 7:21
1

It's pretty easy to do that with CSS

#column-1{
  padding-top:20px; /* Space for image */
  background: transparent url('../images/bg-col-1.png') no-repeat left top;
}
| improve this answer | |
  • I believe this is the "easiest" way to make the change from among the listed solutions. The only fly-in-the-ointment is that there's no UI for changing the image after the site is handed off, or is there? – Screenack Jun 22 '13 at 16:45
  • Thank you @David-thomas I was hoping for the image to be editable via the cms, but this is too easy not to implement as is. Thanks. – kine456 Jun 23 '13 at 23:25
  • You're welcome, if you want to get slightly more fancy, you may want to consider using a CSS sprite and background-position to combine the images into one. – David Thomas Jun 23 '13 at 23:29
0

Additionally, if you need to add individual image for each menu item in a particular menu block you can use this module

You can try Menu Attributes module. You can add specific class and do the css.

This simple module allows you to specify some additional attributes for menu items such as id, name, class, style, and rel.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.