0

I have a code where view is rendered programatically and it contains an image field. However usually images are coming from nodes where different image style is applied so location of image is in different folder. If I preview the view manually style is applied and images appear in the proper styles folder but if this is executed by code it doesnt happen. Anyone with ideas how easily to trigger application of image styles from the code without walking each returned image field, checking is image style applied and so on.

  • Have you tried theme_image_style() which gives html output of your specified image style? – Manikandan Oct 26 '16 at 11:47
0

I went with only solution which came to my mind - foreach the view results, check the image fields and then apply image style and create derivatives. Because when view render image fields programatically it doesn't actually set the files in proper styles folder, it is done on browser request but this doesnt suit our use case.

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.