I have image nodes, and I see their thumbnails in Views. What I also have is a second image field in the Image content type called "Manual Thumbnail". I want to use this original manual thumbnail file as the primary thumbnail for certain nodes. The next step would be to configure Views so that it uses the original manual thumbnail file if present, and not the auto-generated thumbnail.

For this kind of logic, using Views Custom Field module makes sense to me.

Problem: in Custum Field PHP, I print out my data (usng "print_r ($data)"). I can see NID, node title, node type, etc... and my manual thumbnail field. BUT I don't see anything to do with the image field or any auto-generated image states.

In PHP, how can I access the image of an image node, and it's auto-generated instances (like "thumbnail")???

In Custom Field PHP, do I have to access something else other than $data?

Or does the Image module need further support with Views so that its stuff gets included in $data?

Or do I just have to use the NID and grab it myself from a node lode type deal, or directly from the database??? I'd rather not have additional query.

thx

Comments

joachim’s picture

Status: Active » Closed (fixed)

If both your custom thumbnail and the default built-in thumbnail are available to you as Views fields and you want whichever one has content, then this should work: http://drupal.org/project/views_compound_field

Cablestein’s picture

Wow that was ridiculously easy! Thanks.

That module opens some doors, yeesss.

Cablestein’s picture

Issue summary: View changes

updated