I am trying to access content profiles body field (only) from user-profile.tpl.php, but without any luck so far. The devel module tells me there are no other arrays i can fetch other than uid and the full content profile rendition.

Will i need to create a custom sql query to get the body field? Can anyone help a beginner to perform this task?

Comments

stieglitz’s picture

When you created the content type did you leave the body field blank?

jooel’s picture

I'm not sure what you mean. The body field title is mandatory in content type creation, and there is nothing else to submit regarding the body field.

If you meant "when you created the [b]content[/b]: no i'm having data in that field but there is no array/element for content profiles body field, or any of its fields for that matter. Me guessing you'd have to create an SQL query manually.

jooel’s picture

The readme was quite clear enough. I did something like the following:

$var_cp = $content_profile->get_variables('name_of_content_type');
echo $var_cp['name_of_field'];
jooel’s picture

Status: Active » Closed (fixed)