2

I have a content type in which there is a cck image field and now I have listed the images with the node title as a block by views.

Now I want to show the node title when user mouseovers the image. I think I can implement it by views itself but I don't know how to do it?.

Can anyone help?

2 Answers 2

2

I don't think you can do that using views. However you can "hack" a way to add title element to a div, for instance.

go to your view config page

add a node: title field.

edit the node: title field.

tick "Exclude from display" and "strip HTML tags"

click save

move the title node to top of the fields.

edit your image field and tick "Rewrite the output of this field"

a textarea appears. write this code in the textarea

<div title="[title]">[image]</span>

Note: the [fields] are tokens. If you already have a title field, you don't need to exlude it, you can re-use it.

if the image displays another title its because the module automatically sets a title tag to the image. You can either change this tag with javascript:

document.getElementById("idElement").setAttribute("Title", "title");

or edit your image module and set the page title to be your title tag.

0

Use a <span> tag on your views like so:

<span title="[title]">[image]</span>

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.