Posted by ithacaindy on August 23, 2010 at 3:53am
I'm trying to theme a new content type. I have the node-movie.tpl.php file. I want to display the contents of my field_theater CCK entry. I try the following, but just get a blank:
<?php print $theater; ?>
However, if I try to display the node's title, using the same line, the node's title displays. What am I missing?
Comments
I think you need to edit an
I think you need to edit an openpublish_core/theme_helpers/node-movie.tpl.inc file to provide the variable to the node-movie.tpl.php file. You could copy the .inc file from a similar content type if node-movie.tpl.inc does not exist and add the variable. For example:
<?php
$vars['theater'] = $vars['field_theater'][0]['value'];
?>
This makes available the $theater variable to the tpl.php file. If you look at the top of an openpublish_theme/node/*.tpl.php file you will see a list of available variables. This is where they came from.
Have you got the solution to display CCK field?
@ithacaindy - Are you able to display CCk entry?
I have tried solution by @sapark also, no luck.
Neeraj
Valuebound, Drupal development
I think what needs to be
I think what needs to be checked is if you are displaying the fields in your content (content types).
Yes, i am displaying
Yes, i am displaying those fields in new content type
Neeraj
Valuebound, Drupal development