Hi all
I'm a beginning themer and have a couple of questions. I have a custom template for my news_article content type. I use it to automatically insert details like agency source (eg Reuters) and date at the beginning of the text, and to construct a reference line at the end (eg. reuters/af/ss/1720h). I have that working, though I'm a bit worried about using $node->content['body']['#value'] directly. Is that ok, or do I need to sanitise somehow?
My bigger issue is this: if I've overridden the node's template with node-news_article.tpl.php it seems I have to handle the formatting of the fields myself. Some of the fields I explicitly want to format myself in the node template (in fact that's why I'm using one), but others I'd prefer to have their own field-specific template, eg. content-field-field_link_article.tpl.php. I was hoping that $node->field_link_article[0]['view'] would come from here, so everything would happen automagically, but my field template is having no effect. Btw, I do have a content-field.tpl.php present (I'm successfully overriding fields in another content type that doesn't have its own specific node template).
Any suggestions? TIA
Comments
Take a look under
Take a look under $node->content
Great, thanks
Thanks (again!!!) that did the trick. For the record I'm using
$node->content['field_link_article']['#children'];to access the field as formatted by my custom templatecontent-field-field_link_article.tpl.php.