Showing posts with label CCK. Show all posts
Showing posts with label CCK. Show all posts

Wednesday, June 2, 2010

Node: Body outputs entire full node, instead of Body field

The problem is not, as the linked article here suggests, limited to Views representations of Node-body content.  The problem exists in any Node or Page template that is rendered to your website.

The problem arises from the fact that templating BOTH loads a Node, and then runs the "node-alter" routine on it - affecting the Node Body field specifically, to also include contents of CCK fields in that Node.

The problem-code
The problem arises when using this variable-call in a page-template (*.tpl.php) file:
print $node->body;
The solution-code
The solution is to replace the code above with this code instead:
print $node->content['body']['#value'];

Monday, May 31, 2010

CCK - Compound Fields - Image + Rich Text Caption + Taxonomy...

Here is a great article, outlining how to create your very own compound fields for use in CCK. The article EVEN (!!!) supplies you with two concrete implementations of modules, as added bonus...
- Image + Rich Text Caption + Taxonomy
- Modified User-page fields

You may download these two modules from the bottom of the same page, as linked to above...