After moving to the latest dev version. I couldn't manage to make this work. If I try to use the default template i can see all the fields listed on the node page.
But when i try to use my previously working template, it doesn't work. And I think I know the reason of this problem;
There is no "['view'] tagged" variable on the variable list below. This may be because of the CCK version I upgraded. So here is my recent module versions;
Content Construction Kit (CCK) 6.x-2.x-dev (2008-Sep-02)
Content Templates (Contemplate) 6.x-1.x-dev (2008-Jul-09)
Content Taxonomy 6.x-1.x-dev (2008-Aug-30)
btw, I can't revert back to previous versions on some modules. Because I'm getting WSOD everywhere on the site if I do that.
Comments
Comment #1
korayal commentedI found out that;
print $node->field_fieldname[0]['view']is not the method recommended by CCK. The method they offer is like this;
print content_format($field, $item, $formatter = 'default', $node = NULL)So we should use something like this;
print content_format('field_fieldname', $node->field_fieldname[0])but this has problems with the display properties of the field. (different displays on teaser or node view) For example you can't make a field appear as a link on teasers and plain on node pages.
Also an imagefield appears as a filefield on default formatter of "content_format"
Comment #2
korayal commentedFound out that the "default" format type in content_format function is;
what is a default selection on the page;
http://www.site.com/admin/content/node-type/nodetypename/display
if you check the source code of the page, you will find these lines;
As you can see in the code there are option fields in the code like;
from these codes we can understand that if we want from a specific field to be viewed as links, the formatter for that field is link, so;
print content_format('field_dizisinema', $node->field_dizisinema[0], 'link')will show that field as a link. Another example for an imagefield is similar. If we want to show the image field as a imagecache conversion template named afis, and we want that image to be linked to the original image with lightbox2;
print content_format('field_afisresim' ,$node->field_afisresim[0], 'imagefield__lightbox2__afis__original')will do what we wanted.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
Anonymous (not verified) commentednot usre if anyone will reply back but i hope so this does not work for me.
all i get back on the page is 1. not sure whats going on but i just want to display the image through imagecache.
Comment #5
korayal commenteddid you check if imagecache is working?
check the source code of a sample node of that type, search for an image tag with the class "imagecache"
if there is the tag, check if the imagecached file (files/imagecache/banner_image/etc.jpg) exists.
According to http://api.freestylesystems.co.uk/api/function/content_format it supposed to work the same in both 5.x and 6.x (at least it works on me (6.4))
Comment #6
lelizondo commentedsubscribe