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?

4
  • You can create a menu blocks using menu block module and alter the render of block to add the image. Jun 21, 2013 at 4:50
  • Thank you for that @mohit_rocks What exactly do you mean by "alter the render of block "?
    – kine456
    Jun 21, 2013 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/… Jun 21, 2013 at 6:29
  • Are your blocks a menublock creations, or what exactly?
    – Mołot
    Jun 21, 2013 at 7:21

2 Answers 2

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;
}
3
  • 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, 2013 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, 2013 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. Jun 23, 2013 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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