Tuesday, April 10, 2012

Why is my specific page tpl.php not being used?

I can't seem to use a unique page--xxxxxxx.tpl.php for a specific page.



I created a "page" content, filled it in, and gave it a path alias. Let's say: "mypage/mycontent". Then I created a page--mypage--mycontent.tpl.php file in my theme's root. Instead of using it, my page.tpl.php is being used. I was under the impression that Drupal 7 automatically searches for template suggestions using the format of page--path.tpl.php, is this incorrect? Do I need to include specific code in my template.php file first? I did try clearing the theme cache, btw and that didn't make a difference.





1 comment:

  1. If it's just a node, try to rename your template file to page--node--NID.tpl.php and then flush the cache, also don't forget to replace NID with the nid of this node to be something like page--node--11.tpl.php :)

    Hope this works...

    ReplyDelete