By mherchel on
Hi,
I have a CCK node type that has two fields, Left-Column and Right-Column. Both are text fields. I'm trying to create a block that will pull the data from one of the fields "Left-Column" into the block.
I've tried inserting the following into the block. I do have PHP code as the as the input format.
<?php
print $node->field_right_column[0]['safe'];
?>
and nothing will show up on the node's page.
I've also tried the following which pulls the node ID from the URL, but this doesn't work either.
<?php
$nid = print arg(1);
$node = node_load($nid, NULL, TRUE);
print $node->field_right_column[0]['safe'];
?>
Any help would be greatly appreciated!!!
Comments
You should use a view to
You should use a view to display the field.
Just hide it from display in the content type
Add a node type view.
In the view: Add the field that you want to display. Select the style (unformatted, html list, etc). Add an argument of Nid and under default argument use Node Id from URL. Add a block display and save.
Then just put the block in the correct region.
Krystee! You are a genius! I
Krystee! You are a genius! I don't know why I didn't think of that, but it's working like a charm.
Thanks!
Premium component based Drupal themes
Other solution
Or take a look here: http://drupal.org/node/416630
Sasha
Print & Screen