I'm trying to display a photo as background image for a Drupal 7.7 website.

After reading a doc on subthemes, I have created a directory called "pasture" in the same directory where "bartik" resides (i.e. in ~/public_html/drupal/themes/pasture).

  • I have created the pasture.info file.
name = pasture
base theme = Bartik
stylesheets[all][] = pasture.css
files[] = pasture.jpg
core = 7.x
  • I have created the pasture.css file.
#header {
        background:url(/drupal/themes/pasture/pasture.jpg) top left no-repeat;
  • I have saved a public domain image as pasture.jpg. The image is the following one.


Unfortunately, my site appears completely broken, after I activate that theme, and I see numerous warnings:

Notice: Undefined index: Bartik in method drupal_theme_initialize() (line 98 inf file /usr/www/users/simplex/drupal/includes/theme.inc). Notice: Trying to get property of non-object in method phptemplate_init() (line 12 in file /usr/www/users/simplex/drupal/themes/engines/phptemplate/phptemplate.engine).

  • For who doesn't understand Russian, is "в функции" the name of the property?
    – apaderno
    Aug 1 '11 at 15:38
  • Yes, I've updated the question, sorry Aug 1 '11 at 16:09
  • Just curious ... is that files[] parameter used for including images? Have you tried removing it? drupal.org/node/171205 And ensure Bartik is enabled.
    – Jukebox
    Aug 1 '11 at 16:58

I cannot comment, but some remarks

  1. remove the files[] = pasture.jpg line, it isn't needed
  2. you may enable your base theme, but it isn't necessary
  3. put your own themes (modules) under /sites/all/themes or /sites/default/themes, don not put them inside /themes (/modules), if this directory doesn't exist, just create them

Question, does your site works when using the Bartik theme?

  • Site works using the Bartik theme (production: simplex.ru, development: simplex.ru/drupal) and it seems to me that 3) is wrong because I can see my theme among Themes in simplex.ru/drupal/admin/appearance/settings which probably means my custom sub-theme is being found by Drupal. Aug 1 '11 at 20:03
  • you can see the themes inside /themes, it is best practice to put all custom/downloaded things inside sites/all
    – Attiks
    Aug 3 '11 at 16:17

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.