I can't find any variables to display my images. Is this un bug? I'm using a multilingual configuration and I'm having some problem with another contemplate issue in the contemplate.module, line 796 and 797 file. Is it related?

Comments

Swebmas’s picture

Writing <?php print $node->field_image['und'][0]['uri'] ?> in my node--article.tpl.php, display "public://field/image/example_image.jpg" instead of the image . Is it a bug or I just don't get it?
Thank you,

Swebmas’s picture

The solution, <?php print render($content['field_image']); ?>

Swebmas’s picture

Status: Active » Closed (fixed)
_gramur’s picture

Status: Closed (fixed) » Needs review

Solution #2 does not work. I notice that the second solution only works if I untick the "Affect body output" for the body of the node within Article Template.

I have tried placing the code in both node--article.tpl.php and within contemplate to no avail. I am currently using the latest Drupal 7 dev. version.

conspirolog’s picture

Status: Closed (fixed) » Needs review

That's not a bug of Contemplate module. That's because of global changes in drupal 7 file management strategy, in few words: stop generating urls to images directly using their filenames, you must use special functions. And, of course, you should know, there are no more imagecache_* functions, use image styles instead.

Well, that's the code that generates the url to $node->nid with stylized image (Field is field_pic_teaser, image style is 'blogteaser200'):

<?php $image = file_load($node->field_pic_teaser['und'][0]['fid']); print l(theme('image_style', array('style_name' => 'blogteaser200', 'path' => $image->uri, 'getsize' => FALSE)),'node/'.$node->nid,array('html'=>TRUE));  ?>

If you need just to know the URI of image, use $image=file_load(..);print $image->uri;

All this stuff is because there are a lot of changes in public/private files storage functions.

_gramur’s picture

Status: Needs review » Closed (fixed)

Perfect! That is exactly what I was looking for. Anybody else looking to input images through Contemplate should following the above suggestion.

designcontext’s picture

Status: Needs review » Closed (fixed)

Can you please tell me how to display multiple images and - if possible - the integration of colorbox? I can't get the foreach-loop to work...

designcontext’s picture

Can you please tell me how to display multiple images and - if possible - the integration of colorbox? I can't get the foreach-loop to work...

conspirolog’s picture

What troubles do you have enumerating images in foreach?

earthangelconsulting’s picture

re: 35 ... THANKS conspirolog, you just saved my butt! is that documented anywhere or did you just figure that out? :-)