Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
What we had in mind was to show related nodes as images, not as titles, teasers or fullnodes. I added a view, to only show images, but it does not work. I pointed to this view, but it's still only possible to show full-nodes or teasers. Is it possible to get this to work using relatedcontent.tpl.php?
An example of a similar functionality to the related content module with images can be seen on the popular stockxpert site. See example on on http://www.sxc.hu/photo/924257 for related images below the main image.
Comments
Comment #1
TBarregren CreditAttribution: TBarregren commentedSince this can already be done with the RelatedCOntent module, I changed the category of this issue to support request.
You can accomplish this with the API provided by RelatedContent. Following pseudo code shows one way to accomplished what you want:
Following pseudo code is a more "elegant" way to accomplish the same thing:
The benefit with the later version, except from being more "elegant", is that you now can override
theme_images()
in the template.php file, and make it, for instance, to read an images.tpl.php file.Please notice that the above code snippets are only pseudo code and hence will not work without further development.
Comment #2
storbaek CreditAttribution: storbaek commentedI was suspecting that it was possible somehow :-)
I tested both snippets, but I'm unable to get them to work. I changed the 'image_from_node' to 'field_business_image', which is my machine readable fieldname and copied the snippet to my tpl.php file. I'm not sure if I'm supposted to change 'images' in theme('images', $images) or just leave it?
The snippet I used is:
The error I recieve on the page where the images of related content is:
warning: Illegal offset type in C:\xampp\htdocs\Drupal\modules\relatedcontent\relatedcontent.module on line 931.
Also, I'm using imagecache and I'm not sure if that can have something to do with it. I'm assuming that the pictures shown through these snippets will show me the pictures in full-size and not through imagecache, right?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
littly_kitty CreditAttribution: littly_kitty commentedHas anyone figured out how to use the pseudocode?
I think Related Content is an excellent module and being able to display just images (instead of teasers) would be a handy feature.
However, I am new to coding and so would greatly appreciate some pointers as how to change the pseudo code into working code.
(Apologies for changing the status to active, but I thought it would be a better thing to do than to start a new thread).