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.
I have created a node-mytype.tpl.php, and have placed it in both the templates directory and the root of mytheme directory but cant get it to work. node.tpl.php is used instead of node-mytype.tpl.php. Any help would be much appreciated.
Comments
Comment #1
voltron CreditAttribution: voltron commentedComment #2
GiorgosKuse node--CONTENTTYPE.tpl.php
(note 2 dashes --)
Comment #3
fdefeyter@gmail.com CreditAttribution: fdefeyter@gmail.com commenteddoes not work...
Comment #4
charlie charles CreditAttribution: charlie charles commentedhave you cleared the cache?
Comment #5
Samgarr CreditAttribution: Samgarr commentedDoes not work for me, cache cleared...
Comment #6
bryanhidalgo CreditAttribution: bryanhidalgo commentedDoes not work for me either, tried node.tpl.php, and node--page.tpl.php with no success. Cleared cache also
Comment #7
wimper CreditAttribution: wimper commentedI have just tried the ones underneath myself and both are working fine in bootstrap:
node--[content-type].tpl.php
page--[view-page-name].tpl.php
Make sure to use 2 dashes and use the machine readable name for the content types!
Place them in the templates-folder of your theme and everything should work just fine.
Comment #8
hmartens CreditAttribution: hmartens commentedWhere can I get a bootstrap compatible node.tpl.php file because I don't see one in bootstrap folder?
Comment #9
sunnyuff CreditAttribution: sunnyuff commentedHi, bootstrap as it looks to me uses node.tpl.php from core node module. So you need to copy that in you theme templates and then work as normal.
I tried with node.tpl.php and node--blog.tpl.php, works fine.
Hope this helps.
Comment #10
taes_rvr CreditAttribution: taes_rvr commentedIf it's not working make sure you're not rewriting the output with something like display suit. ;)