Closed (fixed)
Project:
Zen
Version:
7.x-3.x-dev
Component:
layout.css
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Apr 2011 at 05:02 UTC
Updated:
21 Aug 2013 at 13:32 UTC
Hello,
I have searched but found little info on how to do this without breaking or deviating from the theme itself.
What I want to do is have roll over images as menu items instead of text. I want to try am personalize the my site a bit. I am sure it can be done I just do not know where to make the edits. I am comfortable with the required CSS and graphic design. Just need to know what to do and where with Drupal and Zen.
Any suggestions would be appreciated. Thanks kindly.
Comments
Comment #1
Jayson Wonder commentedIs this possible?
Comment #2
pixelwhip commentedThis is very much possible. The best place to make the edits is to create a Zen sub-theme. This will allow you to override any CSS and HTML you want, by building on top of the base Zen theme.
This screencast may help:
http://drupalonlinetraining.com/youtube/linwclark/drupal-7-basic-theming...
Comment #3
Deepika.chavan commentedHi,
I tried the rollover effect on my menu items. I added following code in css file (here- 'menu-268' is class of my primary menu item).
Placed 'rollover01.gif' and 'rollover01a.gif' images in '/images/.' directory. Cleared all cached data.
I hope this is what you wanted.
Rgrds,
Deepika Chavan.
Comment #4
barrapontoIn order to have images instead of texts, you should copy http://api.drupal.org/api/drupal/includes--menu.inc/function/theme_menu_... to your template.php, rename it to YOURSUBTHEME_menu_link and change it accordingly. Although you are better off changing the styles just through CSS, using text-replacement instead of rollovers. It would be cleaner semantically, and easier to code. (You might want to look into image sprites as well).
Comment #5
Jayson Wonder commentedThanks for the comments. I am going to have experiment with both methods to see which works best. I am thinking the second method seems more challenging for a relatively new Drupal user.
On simple non-drupal sites I used to use a css on;ly method that used one images and changed the portion of the image that was displayed based on mouse over. The problem is to identify the various sections of css in the many template pages in Drupal.
I will give this a shot though.
I appreciate all for replying and I will write back with my progress.
Comment #6
f0ns commentedI have achieved this on my website using only css:
These CSS classes must go in your ZEN subtheme in navigation.CSS
If you still can't figure this out on your own then please contact me :)
Comment #7
johnalbin