Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By charlie charles on
Hi
I made my own content type
template to change the teaser node
node--content-type.tpl.php
But it also changes the details page
for the teaser.
Is there a way to make a separate
template for details page?
Many Thanks and Best Regards
Charles
Comments
---
The name of your template will target all nodes with that content type. I think teaser templates are titled: node--[content type]--teaser.tpl.php
So rename your template file and you should be fine.
Many Thanks for your
Many Thanks for your help.
I've Just found out there is no teaser template
for Drupal 7
I found this post
http://drupal.org/node/396006
I tried adding the code to the page.tpl.php
that didn't work
Then I tried the node.tpl.php
That didn't work either.
Any suggestions?
Many Thanks and Best Regards
Charles
---
I believe that code needs to be placed in the template.php file.
Is this correct?
Thank you for your time and help.
I added php to the template.php
but I got this error message
"Fatal error: Cannot redeclare responsive_bartik_preprocess_node()"
Would you let me know please is this right?
It worked!
I put
function inmobi_preprocess_node (&$variables) {
$variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__' . $variables['view_mode'];
}
on my "inmobi" theme template.php
Now my node--article--teaser.php works!
Thanks
Thanks for sharing, that
Thanks for sharing, that worked for me too!
node--[content type]--teaser.tpl.php
stystem folder- > page.vars paste code
function THEMENAME_preprocess_node(&$vars) {
if($vars['view_mode'] == 'teaser') {
$vars['theme_hook_suggestions'][] = 'node__' . $vars['node']->type . '__teaser';
}
}
node--[content type]--teaser.tpl.php
CODE:-
<?php print render($content['FIELD_NAME']); ?>