Hi there,
I have video_cck installed and this module using static "See Video" text as thumbnail's TITLE and ALT properties. I have changed the module and intead of "See Video" text it should show node title ($node->title).
I am using these thumbnails in views.
When I use view with "Full nodes" and "Teaser List" view types the image title is shown correctly.
When I use view type "Bonus: Grid view" image title is blank.

When I using $node->nid as image title in all these 3 view types it shown correctly.

I have to use "Bonus: Grid view" view type because all I have to show in this view is list of thumbnails. Why in "Bonus: Grid view" view type the $node->nid is shown correctly and $node->title not. How can I solve the problem?

Thanks.

Comments

platypus media’s picture

This is because when you output $node->title, you're not outputting the raw text from the title. You're creating the <h2 class="title"> tags, the <a> tags that link it back to the node, etc. If you want to set the image title to $node->title, you're going to have to do a little bit of theme work in your views-myview.tpl.php file to create a variable for it to put into your <img title='<php print $mytite ?>' alt=...> tag.

dima700’s picture

This is because when you output $node->title, you're not outputting the raw text from the title.

When I choose "Full nodes" and "Teaser list" view types I have no problems.
Only when I choose "List View" or "Grid view" I have a problem.

In "grid view" type the html code that generated for cell where the image is shown is:

<td class='view-grid-item'><div class='view-item view-item-prikol'><div class='view-field view-data-node_data_field_video_field_video_embed'><div class="field-item"><a href="/node/379"><img src="http://img.youtube.com/vi/wfDXJAa0D80/1.jpg" width="120" height="90" alt="" title="" /></a></div><div class="field-item"></div><div class="field-item"></div></div></div></td>

As you can see alt="" title=""

This part of code generated by video_cck module:

<a href="/node/379"><img src="http://img.youtube.com/vi/wfDXJAa0D80/1.jpg" width="120" height="90" alt="" title="" /></a>

where ALT and TITLE defined in module as:

  . '" alt="' . $node->title  . '" title="' .  $node->title
sun’s picture

Status: Active » Closed (won't fix)

Sorry, unfortunately this support request is way too specific. Please have a look at the issue queue - Views maintainers are buried already. You might want to try to get further support at http://drupal.org/support.
If you were able to solve this issue on your own in the meantime, you might want to add the involved steps to this closed issue, so other users searching for a similar solution might find it.