2

I am building a custom theme. Currently, I put all the overridden *.tpl files under the theme root folder; it would be more clean and meaningful to put those files under "mytheme/templates", but Drupal does not recognize them after I move them. (I did clear the cache.)

Did I miss any steps?

2
  • Did you clear all the cache? How did you do that?
    – apaderno
    Commented Mar 24, 2011 at 14:06
  • drush cache-clear all
    – gilzero
    Commented Mar 25, 2011 at 4:52

3 Answers 3

1

I've also run into a situation where I had to create a page.tpl.php file before Drupal would recognize other page--foo.tpl.php files.

1
  • If I'm not mistaken, that is only the case in Drupal 6. Drupal 7 should be able to discover node--article.tpl.php without having to create node.tpl.php. Commented May 23, 2011 at 12:30
0

Did you use the new template suggestions with two hyphens instead of one ?

For instance, page-front.tpl.php becomes page--front.tpl.php in D7

More on drupal.org

1
  • yes, i am using the new template suggestion convention. like I said, if I put tpl under sites/all/themes/mytheme, it works, but if I moved then to sites/all/themes/mytheme/templates, then clear all cache, re-enable mytheme, doesn't work.
    – gilzero
    Commented Mar 25, 2011 at 5:03
0

I have a copy of Bartik Theme named Vartik.

In the templates folder I have the original page.tpl.php and I have created a page--node--add--CONTENT_TYPE_ID.tpl.php and it works.

Try it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.