Hello, is there a field available for this?
Do you know how i can get a hover over an image?

Thanks

Comments

bsenftner’s picture

An image's "title" attribute is the hover text.

ed r’s picture

Hello bsenftner,

I disabled the titles in my website, but when i had titles there was no hover either.

So i don't think it always works automatically.

Could there be an interference with my theme, view settings etc.

Hope you can help.

You could se an example here.
http://www.edwardo.de/node/586

Greetings,
Edward

bsenftner’s picture

Hi Ed,

I just tried taking a text copy of your page source, added "title" attributes to the image, and I got hover text...

From your page:

<img src="http://www.edwardo.de/sites/default/files/imagecache/reg/photos/Philip_Glass01.jpg" alt="Picture of Philip Glass" title="my added hover text"  class="imagecache imagecache-reg" width="565" height="377" /></a>

Note, you had a title attribute, with an empty string, so I just added some text, reloaded your page (but my copy) and the hover text appears when I pause my mouse over the image...

ed r’s picture

Hello Blake,

I also saw in my source code that the title was empty.
Right now i don't know how i can use it.

Hopefully you can give me a (another) hint.

But i will surely give it a try searching files, settings, etc.

Thanks!

Greetings,
Edward

bsenftner’s picture

Well, how are you creating your pages? Are you using some wysiwyg editor (IMCE, CKEditor, other...)? Most such editors let you specify the title tag when you specify/embed an image in a page. Then that title appears as hover text. Other editors either work with the raw html source, or you can hit a link to get to the 'source view' and edit the raw html. From there, just type...

ed r’s picture

This post (My post) does not make any sense.
You could see my updated post lower on this page:

Photos are not uploaded with editor
ed r - June 13, 2010 - 23:36

mcfilms’s picture

When you say "I disabled the titles in my website, but when i had titles there was no hover either," I think you mean you got rid of NODE titles. Right? When you upload an image you should have the ability to title the image. Do you see this?

If not, it is possible the theme is preventing it.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

ed r’s picture

For uploading my images i've got a create photo content.
With this i've got an option for adding title, description and alt text.

Right now i've changed three title things:

1.
In my original page.tpl.php file was this:
<?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>

I have changed it to this:
<h2 class="title"><?php if ($title == "") print $title ?></h2>

This was for preventing drupal to put a title above my contact form and slideshow.

2.
In my original node.tpl.php file was this:
<h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>

I have changed this to:
if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif;

This was for preventing drupal to put a title above the images on my front page (and the following pages).

3.
I have removed the titles from my views (side building, views).
This was for removing all the same titles from the galleries.

Step two was for removing the titles on top of images (on the frontpage and further). Right now i know that i want this titles above these images, so i think i can change it back
to the original code.

But, to come to the point. I am sure that before changing these things above there was no hover on top of the images.
I think mcfilms is right with this and that it has got something to do with my theme.
Sadly my knowledge is lacking to much for pinpointing the problem.

Thanks alot,
Edward

dman’s picture

You are describing your page titles, but asking about image titles.

This is an image without a title:
<img src="http://www.edwardo.de/sites/default/files/imagecache/reg/photos/Philip_Glass01.jpg" alt="Picture of Philip Glass" width="100"  />
Picture of Philip Glass
This is an image with a title attribute - as bsenftner showed you earlier
<img src="http://www.edwardo.de/sites/default/files/imagecache/reg/photos/Philip_Glass01.jpg" alt="Picture of Philip Glass" title="my added hover text"  width="100"  />
Picture of Philip Glass

ed r’s picture

Hi Dan,

Thanks for zooming in on the problem.

I think i've got the problem sharp now.
But i can only put text in my field "title"
And i think there is no way in changing the field for editing it with wysiwyg or something.

Can you point me how to do it, cause i can't change the sourcecode directly (as you know).

Thanks man!

dman’s picture

bsenftner asked you earlier, but you haven't described your WYSIWYG, so it's hard to say.
I know that FCK editor, CKeditor, TinyMCE do have the facility to add the title attribute as properties on an image. Generally you right-click the image and show 'advanced' options. "Advisory Title" in CKeditor

ed r’s picture

Hi Dan,

I've got CCK. And you are right. I overlooked the post of bsenftner/Blake. Too much beer i think. Sorry Blake.
Do you think installing another module will work?

Greetings,
Edward

ed r’s picture

Hello,

You have probably seen that i was a bit confused about the name of my editor.
It was fckeditor and it's now ckeditor.
But i think this editor can not help me with my question (right now).

You are right. If you upload a picture with an editor mentioned above the hover does show up.
But the photos on my website ar not uploaded with an editor.

They are uploaded with a field called image in a create content page. And yes, there is a title box on this create content page.
There is no editor connected to this title box.
Is it possible to make this connection (for example with Manage fields in Content managent)?
Or is there another way to create a hover?
Perhaps i have to change the theme code? If you know what code can be used in the theme to activate hovers/fill title in source code. Please let me know.

Thanks.

ed r’s picture

I think the images nodes already had a title.

The title for the images was not activated.

All i had to do was enabling custom title text in Title text settings.

Thanks.

Greetings,
Edward