I have body variables, but I do not have any content for the body template.

Comments

Teebo’s picture

Priority: Normal » Critical
jrglasgow’s picture

Status: Active » Postponed (maintainer needs more info)

do you have a node of this type created?

bomarmonk’s picture

I think the problem teebo is submitting here: when editing a content template for a CCK content type, the variable for the node "body" field is not available. You can include the entire body of the node, which pulls in all content. But I have an independent body field that is called "about." This is not available in the variables list. I am not sure why,,,

jrglasgow’s picture

could you please paste in the body variable for me please.

bomarmonk’s picture

The only variable that pulls in CCK's body field, is the $node->body. There should be a variable that pulls in just the CCK body field, not the entire node body. For some reason, whether I rename the body field and resave, this field is still not available to content template's body variables... here is a copy of the node body:

$node->body
    <table class="profile"> <tr><td class="profile_pic" valign="top"> <IMG SRC="/mysite/files/ss.jpg" WIDTH="167" HEIGHT="222" ><div class="profile_title"><h3><center> Title </center></h3> </div> </td> <td class="profile_about"><p align="left">
Content goes in here (this is the content from the field that should be represented by a variable, but is not)
</p> </td></tr> </table>
jrglasgow’s picture

can you paste in the entire $node variable.

dferrante’s picture

I am having the same problem. I am using the ImagePicker module to allow multiple images to be uploaded into the "Body" text area of my Content Node. I have adjusted the text layout for my Teasers for this Node type to my liking, and now I want to also show the images that were uploaded via ImagePicker. My problem is, I have no way to reference only the Body text area field through ConTemplate. It seems that making reference to the $node->body object actually pulls the entire content of the node - and I only need the content from the text area called "Body".

Any advice??

thanks!

dferrante’s picture

Ok, I was able to fix my issue. Here's what I did, maybe it will help someone else...

Since I am using the ImagePicker module for image uploads, I edited the .Module file to solve this. My original problem was the ImagePicker module, by default, puts the HTML for your images into the Node's default "body" field. I was only using that "body" field to hold the HTML for the images (since I was using CCK to create my own custom data fields). I then wanted to use ConTemplate to change the Teaser layout but when referencing $node->body from Contemplate, it was actually returning ALL of the content in the node - not just the field called "body".

So... I edited my Content type and removed the default "body" field and then used CCK to create a new custom text field called "Images". But, ImagePicker uses javascript to insert the HTML for the images into a "destination" field - which now no longer exists. So I just edited the .Module file in ImagePicker and changed the one line of code in there that referenced the old default "body" field and instead made it reference my new CCK text field.

Now I can access the content of that CCK field using the standard reference of $node->FieldNameGoesHere and it only returns the true data in the field - not the entire node's data.

My issue was more specific to what I was trying to accomplish and the combination of ImagePicker and ConTemplate... BUT it does help point out the issue of trying to reference ONLY the content in the $node->body object.

regards,

Domenic