I want to add some html just before the start of body of all pages. I have managed to do so by adding the html before the body tags in html.tpl.php. It works fine. But it appears in all themes. I want it to appear only for my default theme (i.e. stark). How can I do that?

  • which html.tpl.php did you eidt? Jan 19, 2013 at 15:06
  • The one in modules/system/
    – MFA
    Jan 19, 2013 at 15:21
  • Please look at my answer. you would need to copy the file to your theme folder and edit it there. Jan 19, 2013 at 15:23

1 Answer 1


You should be editing the template file with in the theme. By default stark does not have any template files. You should copy the required template file to the theme you are using and then edit the same there.

  • I know it should be solved using template files but so far I have been unable to do so. I have created a page.tpl.php but I cannot figure out what code will go inside. All the pages on my site are Page Display of Views instead of the Page content type.
    – MFA
    Jan 19, 2013 at 15:25
  • you are right. I copied the html.tpl.php file in my theme folder and edited it. Works now. Thanks a lot!
    – MFA
    Jan 19, 2013 at 15:29
  • you should take a look at the other themes rather than stark. Stark is the very strip down version of a theme to understand how the output from drupal modules come. I think you should take a look at the zen theme drupal.org/project/zen. it has got a good structure and has all theme templates with in the template folder. Jan 19, 2013 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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