So yes, there are many instances where I need to load a filtered node object and pass it off somewhere.
$node = $node_load($nid);
That works great for CCK, however, it loads the *value* instead of the *view*. This is a pain because I want the Drupal filters to be applied, not just the raw data for each field.
Is there something I'm missing?
Comments
Comment #1
m3avrck commentedNm, seems this is the best approach:
check_markup($node->field_topics[0]['value'], $node->field_topics[0]['filter']);
Right after you load the node, pass in the value and the filter and it works, wahoo!
Comment #2
jkitching commentedI tried the line that you posted, but it doesn't do anything for me. I'm using Drupal 5. Any other solutions?
Comment #3
yched commentedyou should use content_format('field_name', $node->field_topics[0]) - add the formatter as an optional 3dr param, but the default ('default') should do just what you expect.
Comment #4
loze commentedjust thought id post for anyone having trouble with the code in #1 for D6
i had to use
check_markup($node->field_topics[0]['value'], $node->field_topics[0]['format']);not
check_markup($node->field_topics[0]['value'], $node->field_topics[0]['filter']);Comment #5
sobi3ch commentedfor whole node node_prepare() is the solution
Comment #6
sobi3ch commentedsorry for #5, there is something higher, and it's call node_build_content()