Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Lostmonkey on
Hi,
I'm trying to use this snippet I found in here to display a random thumbnail image from a specific gallery. I works fine, however I would like the thumbnail to link to that specific gallery overview page.
What do I need to add to the code to make this happen?
$count = 1; /* CHANGE THIS: how many images you want? */
$tid = 42; /* CHANGE THIS: put in the valid "tid" of the image gallery */
$nodes = image_get_random($count, $tid);
foreach ($nodes as $node) {
print image_display($node, 'thumbnail');
}
Thanks,
Mikkel
Comments
*bump*
Anyone?
Me too
I am trying to do this on a site too. Keep hitting a brick wall though. Anyone with some thoughts?
Spoke a moment too soon. Found the solution at:
http://drupal.org/node/64801