Language
  • English
  • Français
Drupal custom theming or module development price estimate calculator

passing cck fields as argument to a view

hi

i've added a cck field (named field_luogo) to a node

and now i would like to add to the node a php snipplet getting the cck field value and passing it as argument to a view;

so i've tried

$node->field_luogo[0]['value'];

but i get no value

is this the right way ?

thanks pierluigi

You should test to make sure

Aaron's picture

You should test to make sure that that particular field is being written correctly by printing it somewhere in the node tpl.

  <?php print $node->field_luogo[0]['value']; ?>

If that doesn't work then there is something being written wrong. If all is well on the the test then you just need to pass the value in programatically when you call the view. You will also need to make sure the view is correctly configured to receive the argument. If in doubt feed a dummy argument that matches the data type you are expecting from cck into the view and see how the view responds.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Ask a question related to Drupal development or administration