Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Moderate on
Hi all !
I've just created a custom field called "field_right_column" for one of my content types.
I would like to render it in node.tpl.php, so i put :
<?php if($content['field_right_column']): ?>
<div id="rightcol"><?php render($content['field_right_column']); ?></div>
<?php endif; ?>
<?php
print render($content);
?>
But nothing's happening. I've just
<div id="rightcol"></div>
in the source.
How can i render this very simple custom field ?
Thks everybody :)
Comments
Hi, Replace your code with
Hi,
Replace your code with this to print your custom field :
Thanks