Hey I have caption set for Node Title.
When I have a block with a View which contains thumbs from each node the caption is not appearing.
I expect Node Title in each caption which I already linked changing line 587 from:
return $node->$field;
to
return "path'>" . $node->$field . "";

It works when I zoom being on the node. But when I have a block with each thum from different node rendered by Views module, the caption is gone.

How can I get node path and title zooming from view block ?

What I want to do is first show a preview using Highslide and if user wants to see a full node with more pics, them he can click in the link in caption.

THANKS

Comments

benone’s picture

The code I pasted was filtered so I paste it again here. It actually does not have anything with this issue, just want you to know what I already changed in the module to get what I want to do.

      return "<a href='/$node->path'>" . $node->$field . "</a>";
q0rban’s picture

Hi there! so if you revert back to the original code, does the caption show up properly?

benone’s picture

Hey! Caption shows properly.
It just doesnt show when I Zoom from a view full of thumbnails from different nodes.
Thumbnails are not linked to node in a view setting. I just choosed Highslide Default in a view setting instead to first Zoom the picture and if its interested show a link to the node in caption. Do you understand what I mean ?
The problem is when I zoom from thumbnail which is a part of view (instead of node) the caption is not shown.
When I go to the node and Zoom over there from any thumbnail the node Title is shown in the caption like it should.
It just doesnt work for a view.

I hope I described it easy. :)

Thanks for you response!

benone’s picture

Any ideas about that ?

benone’s picture

I found the solution. Dont know how to do the patch so just paste it here. In file highslide.module find:

/**
 * Helper function to assemble the caption content.
 */
function _highslide_caption_content($node, $field) {
  switch ($field) {
    case 'title':
    case 'body':
           return $node->$field;
    default:
      if (($field_array = $node->$field) && is_array($field_array)) {
        return $field_array[0]['value'];
      }
  }
}

and change to this:

//benone - hack function for views. title and path in caption when zoomed from a view.
function get_title_path_magically($nid, $arg)
{
$node = node_load(array('nid'=>$nid));
if ($arg=='title') {return $node->title;}
if ($arg=='path') {return $node->path;}
}
//benone hack function - END

/**
 * Helper function to assemble the caption content.
 */
function _highslide_caption_content($node, $field) {
  switch ($field) {
    case 'title':
    case 'body':
      //benone hack
      if (!$node->title) {
           return "<a href='/" . get_title_path_magically($node->nid,path) . "'>" . t('View more about') ." <font style='color:black'>". get_title_path_magically($node->nid,title) . "</font></a>";   
      }
      else {
           return $node->$field;
      }
      //benone hack - END
//           return $node->$field;
    default:
      if (($field_array = $node->$field) && is_array($field_array)) {
        return $field_array[0]['value'];
      }
  }
}

Hope somebody will find it useful in the future :).

q0rban’s picture

Ah yes, I see the problem. The node body is not available in a fields view. Will look into a fix for this, thanks!