May not be posted under the right area...but it is for a theme.
Seeing $content is used to basically show everything....I was wondering if there was a way of separating the title, creation date and the the article into separate variables that could be used to display the content differently. I did a bit of searching and didn't come across anything that stood out.
So basically...looking to have the following variables from $content when it comes to displaying article content.
$title
$creation
$article_content
Is there a way to do this...taking into fact that other things are passed through $content (like account view, editing content....) Not so much worried about the administration side of things seeing another theme is going to be used for this area.
I want to make it clear that I am not talking about the site title here...just the article title.
Comments
If you are talking about node
If you are talking about node content you can modify node.tpl.php (applies to all content types) or for a single content type copy node.tpl.php to node-content_type.tpl.php,for example if your content type was 'bike' you would copy node.tpl.php to node-bike.tpl.php. You can then modify the new file. Not sure whats available to print, see http://drupal.org/node/11816 (for Drupal 6 see http://api.drupal.org/api/file/modules/node/node.tpl.php/6)
Yea...that's what I just
Yea...that's what I just figured out.
http://drupal.org/node/11816
I just came to put that link in here in case somebody has a brain slow down like I just did. Thanks for the response nevets!
I guess I don't understand how it would be called (node-content.tpl.php).
It's not called by your code
It's not called by your code but through the theming of the node. So when a node is viewed it is passed to a theme function which ends up using node.tpl.php by default but can also use a content specific .tpl.php if present.
I understand the above, that
I understand the above, that you can use the variables from http://api.drupal.org/api/drupal/modules--node--node.tpl.php/6 to show certain elements.
However, $content contains not only the body content but also any images that are uploaded. If I wanted to show an uploaded image in a different area, anyone know how I would refer to it?
I've tried things like :
<?php print $node->content['field_image']['#value'] ?>(in a custom node.tpl.php file for the content type, and a custom page.tpl.php file is showing $content)
But I don't know if that works for a regular custom node..
Any help is appreciated!