1

Trying to add a hover overlay for node title and a couple of other fields for images using the views photos grid module.

The fields to be used in the overlay need be excluded from the display as the module only uses one image field, however I am not managing to add the excluded fields.

If I the preprocess to template.php

`function THEME_preprocess_views_photo_grid_style(&$vars) { $vars['raw_result'] = $vars['view']->style_plugin->rendered_fields;}`

I can print the titles using

`foreach ($raw_result as $row) {print $row['title']; }`

which prints the titles on the page outside the container as a row, but I can only add the last title to the overlay. Need to be able combine each title to each image that is shown using

`foreach ($items as $key => $item):

print $item; endforeach;

  • You can accomplish this with CSS and jQuery... – No Sssweat Jan 29 '16 at 0:50
0

As the arrays line up, added an index and combined the arrays

$index = 0; foreach ($items as $key => $item):
print $raw_result[$index]['title']; $index++
print $item;

Works

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.