5

I am having great difficulty in trying to create my own theme. The errors that persist are:

Notice: Undefined variable: hide_site_name in include() (line 98 of C:\wamp\www\drupal7\sites\all\themes\ppro8\templates\page.tpl.php).
Notice: Undefined variable: hide_site_name in include() (line 108 of C:\wamp\www\drupal7\sites\all\themes\ppro8\templates\page.tpl.php).

I copied all files from the bartik theme into /sites/all/themes/myTheme/, and did the following:

  1. I changed bartik.info into myTheme.info, and 'name = bartik' to 'name = myTheme'.
  2. I replaced all occurrences of 'bartik' in templates.php to 'myTheme' (search and replace with notepad++). Up to this stage, the error still shows, so I tried the following as well:
    • I replaced all occurrences of 'bartik' in all files in the folder 'myTheme'

However, none of the above steps could remove the errors.

Could anyone please shed some light on this issue?

  • It sounds like you are doing everything right. Did you clear your cache? Also, other than changing all the names, did you remove or comment out any code either in the info file or in template.php? – Danny Englander Feb 23 '12 at 16:13
  • hi danny thanks for the response. this is really very very weird, i setup drupal (same settings) on my LAMP Ubuntu Linux 11.10 and everything works fine. but WAMP on Win7 doesn't seem to want to work...would you happen to know why? – czchlong Feb 23 '12 at 16:46
  • Did you change the code of the theme when it was enabled, and used from Drupal? – kiamlaluno Feb 23 '12 at 17:22
  • hi kiamlaluno, what do you mean by change the "code" of the theme? I made the exact same changes on ubuntu and it works. Could you please elaborate on what "code" you are talking about? Thanks! – czchlong Feb 23 '12 at 17:40
  • You may want to copy over the bartik page.tpl.php file from Ubuntu and placing it in the Win7 version just in case you did accidentally change something else. (This may be fruitless but...)Also turn on the site name & slogan in your theme's settings and see if the error shows up on line 102. – Ashlar Feb 23 '12 at 23:09
0

I know that this question asked before 2 years ago. today only I came up with this problem.

I've pasted:

$hide_site_name = theme_get_setting('toggle_name') ? FALSE : TRUE;

at the second line of page.tpl.php and that solved my problem.

| improve this answer | |
0

I had exactly the same problem here and complete system cache clearing helped me out.

Configuration -> Development -> Performance -> Clear all caches.

That solved the problem for me.

See: Undefined variable: hide_site_name in include() while change theme

| improve this answer | |

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