By nothinghere on
Hi,
I've a question : I'm search a way to use an image for my main menu items, not a text.
I've drupal 7, and blueprint theme.
Anyone can give me some tips ?
Thanks !
Hi,
I've a question : I'm search a way to use an image for my main menu items, not a text.
I've drupal 7, and blueprint theme.
Anyone can give me some tips ?
Thanks !
Comments
Warning : If you tell me to
Warning : If you tell me to use "image menu", know it's not compatible with D7 ! :(
_
I don't think there is any way to display normal menu items as images. However, there is a workaround if you just need a flat menu structure.
Basically, you need to make a content type called "menu image" (or whatever you like), create some nodes with an image field, and make a block view with the Views module where you include the images of those nodes. Then you let each image link to a node, a view or whatever.
After saving the view, you enable the block in whatever region you want, and voila: you have an image menu! You could even make it multilingual using some of Views's language filters.
If you want the menu to display horizontally, you might need to make some adjustments to your theme's CCS file.
Views can be a little tricky to configure, so just ask if you need more detailed instructions.
Thanks you, I see. I'll gonna
Thanks you, I see.
I'll gonna try that !
_
Glad I could help. Please write back how it goes. If you find Views too complicated, have a look at this magnificent video series:
http://nodeone.se/blogg/learn-views-screencast-series-summed-up
@LarsKramer : view in one line
@LarsKramer : I'm trying your way. But my node wich contain all my pictures, display vertically.
All pictures are displayed in a "list" style. I've trying differents settings of views (not only the list or grid one), but I can't find how to display all pictures on one line.
How can I display :
- only body, not title or other stuff ?
- all pictures/images in one line (with links) ?
Thanks for help !
PS :
<?php print l('Home', 'node/9', array('attributes' => array('class' => 'homenav'))) ?>don't seem to do anything... (node/9 is my menu)._
You need to use the field (not teaser) display format, and then choose the image and link fields from your "menu image" content type (I recommend putting the images in separate nodes, and adding a link field containg the link to the page you want the image to link to). You don't want to display the link with Views, but use it as link reference in the settings for the image field: "Rewrite the result > Output this field as a link" using the value of the link field as replacement token. In order for this token to be available, the link field must come before the image field in order in Views.
As style you could use either unformatted or list, and then edit your theme's css file to display the items inline instead of as block, either using the default selectors provided by Views or by adding your custom class names (click "Format settings" in Views).
I hope this gets you on the way :-)
Use Drupal l() function
Use drupal l() function to generate link
print l('Home', 'node/13', array('attributes' => array('class' => 'homenav')))and in class homenav in css give your image.
How can I use this function
How can I use this function ?
Copy that in page.tpl.php, where I need it ?
It's a stupid question, but it's first time for me and I begin with drupal ...
Anyway... thanks you!
Yes copy that in page.tpl.php
Yes copy that and put in page.tpl.php