Are there the following steps corrects to add a node-[type].tpl.php template to my theme?
Steps:
1. create file node-type.tpl.php, for example, node-news.tpl.php
2. Add the following code:
<?php
// $Id: node.tpl.php,v 1.4 2007/08/07 08:39:36 goba Exp $
?>
<div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
<?php print $picture ?>
<?php if ($page == 0): ?>
<h1 class="title"><a href="<?php print $node_url ?>"><?php print $title ?></a></h1>
<?php endif; ?>
<span class="submitted"><?php print $submitted ?></span>
<div class="taxonomy"><?php print $terms ?></div>
<div class="content"><?php print $content ?></div>
<?php if ($links): ?>
<div class="links">» <?php print $links ?></div>
<?php endif; ?>
</div>
3. Go to "Administer > Site configuration > Performance" and select Clear button:
Clear cached data
Caching data improves performance, but may cause problems while troubleshooting new modules, themes, or translations, if outdated information has been cached. To refresh all cached data on your site, click the button below. Warning: high-traffic sites will experience performance slowdowns while cached data is rebuilt.
4. In this moment all nodes of type news are drawn like is specify in the template no?
Thanks and regards,
Álvaro.
Comments
Don't forget
I'm fairly new to Drupal, but I believe this looks correct. However don't forget to have copy of node.tpl.php in your themes folder as well. If you do not have this (the base theme you are overriding), your template suggestion will not be picked up.
are u sure?
I'm new in Drupal too. Are u sure? U need the base tpl template?. it has sense that u say.
I think that the procedure that I explained is correct ... but somebody with more experience in Drupal?, Isn't there another thing to do?
Thanks amigos.
Yes, the steps you posted
Yes, the steps you posted are correct, and yes, like bkildow said, you need to have the base template file in your template directory.
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials
---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com
Ok ... Gracias (thanks)
Ok ...
Gracias (thanks) Amigos
Bye!
not work
Hi,
I have the the maintenance-page.tpl and page.tpl.php in my theme directory but when I site off Drupal, I could see the garland maintenance blue page...
I've cleared the catches ...
What's wrong?
Thanks,
Álvaro.
I've read this
I've read this post:
http://drupal.org/node/222516
And I change the settings.php like it is mentioned but I have the followings warnings when I connect to my site off.
warning: array_keys() [function.array-keys]: The first argument should be an array in includes/theme.maintenance.inc on line 217.
warning: Invalid argument supplied for foreach() in includes/theme.maintenance.inc on line 217.
Any suggestions?