Closed (fixed)
Project:
Content Templates (Contemplate)
Version:
7.x-1.0-alpha1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2011 at 17:26 UTC
Updated:
4 Jul 2012 at 22:40 UTC
Comments
Comment #1
Swebmas commentedWriting
<?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,
Comment #2
Swebmas commentedThe solution,
<?php print render($content['field_image']); ?>Comment #3
Swebmas commentedComment #4
_gramur commentedSolution #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.
Comment #5
conspirolog commentedThat'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'):
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.
Comment #6
_gramur commentedPerfect! That is exactly what I was looking for. Anybody else looking to input images through Contemplate should following the above suggestion.
Comment #7
designcontext commentedCan 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...
Comment #8
designcontext commentedCan 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...
Comment #9
conspirolog commentedWhat troubles do you have enumerating images in foreach?
Comment #10
earthangelconsulting commentedre: 35 ... THANKS conspirolog, you just saved my butt! is that documented anywhere or did you just figure that out? :-)