Hi,

I'm new to drupal and not a developer and I have some issue to create a sub-theme for Corporate Clean theme.
I've followed this step by step guide http://opensourcecms.pro/drupal/howto-drupal-7-sub-theme-creation-step-b... but at the end it doesn't work at all.
The scrolling banner it's all over the page now, in UI when I access settings for sub-theme is giving some errors like this:

•Notice: Undefined index: CorporateClean in system_theme_settings() (line 575 of /home/username/public_html/modules/system/system.admin.inc).
•Notice: Trying to get property of non-object in system_theme_settings() (line 575 of /home/simiid/public_html/modules/system/system.admin.inc).

Also in themes page I get this:
•Notice: Trying to get property of non-object in drupal_alter() (line 1001 of /home/username/public_html/includes/module.inc).
•Notice: Undefined index: CorporateClean in drupal_theme_initialize() (line 98 of /home/username/public_html/includes/theme.inc).
•Notice: Trying to get property of non-object in phptemplate_init() (line 12 of /home/username/public_html/themes/engines/phptemplate/phptemplate.engine).

What do I do wrong ? I am not a developer. Can this be fixed or is a bug with the theme itself ?
Is someone willing to write in wiki a step by step guide on how to create a sub theme for this theme ?

Thank you,
Catalin

CommentFileSizeAuthor
#3 corporateclean_subtheme.zip83.08 KBsimi_id
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iflista’s picture

Component: Code » Documentation
Assigned: Unassigned » iflista
Priority: Critical » Minor

Upload your subtheme somewhere and give me a link. I'll look.

iflista’s picture

Status: Active » Closed (fixed)

Issue is fixed.
Errors were generated by this code included into subtheme.info

project = "corporateclean"
; Information added by drupal.org packaging script on 2012-05-25
version = "7.x-1.5"
core = "7.x"
project = "corporateclean"
datestamp = "1337952655"
simi_id’s picture

Status: Closed (fixed) » Active
FileSize
83.08 KB

I fixed this issue thanks to iflista ...

Following the tutorials on internet about how to create a subTheme in Drupal here are some extra steps, not so difficult ones.
First of all the rotating banner is hard coded instead to be used a block for it. So for changing it you have to edit page.tpl.php

How to subTheme CorporateClean theme.

1: In your Drupal site admin area go to Appearance

2: Click install new theme press choose file and select corporateclean-7.x-1.5.zip and then press Install
Note: After you are done with installing new theme, you may disable it if you don't want to appear in that list.

3: Go to your theme install folder "/sites/all/themes" and create a new folder called whatever you want. I've chosen "corporateclean_subtheme"
Note: Please notice that the main theme folder name is written with lower characters as well I write also the subtheme folder with lower character as well

4: Now, into your newly created folder copy
corporateclean.info
# filename.info is mandatory for every subtheme we create
style.css
/color/colors.css
#css files, since they were mostly needed to change the font, colors and so on
screenshot.png
#this screenshot will appear in your Appereance menu tab along with the other themes so you see what is about your theme, you may modify it as you wish
logo.png
#this is the logo of your page, you may modify it as you wish

!! and now the extra steps for this theme, since the previous steps are the basic steps for every theme in drupal to create a subtheme

/images folder
#you have to copy your "images" folder in order to have that rotating banner to work, else you will get some errors as most of the users and me got. I'm not a developer but I think some requests or functions are made to /images folder and it's looking for that folder in the root folder which is your subtheme now, doesn't also look into main theme
page.tpl.php
#in order to edit that rotating banner text, title, ... you have to edit this page. It is hardcoded, not a block.

5. After you copied the mentioned files now we have to edit .info file. Starting from original file do only the following changes:
- edit the first line with name "name = CorporateClean SubTheme" this is the name which will appear in your Appearance tab
- add a new line "base theme = corporateclean" for drupal to know on which theme will be based this subTheme.
* as an important note here, what I've done wrong .. is that "corporateclean" should be written in lowercase as the main folder as I previously said. My mistake was that I was writing "CorporateClean" and that's why I was getting a lot of errors.

For making things easier in case you have issues, I've attached a zip file with the above changes already made. All you have to do is to extract in your /sites/all/themes and starting subtheme-ing CorporateClean theme.

Many thanks to iflista.

Note for post before:

- removing the last lines doesn't fix the issue
project = "corporateclean"
; Information added by drupal.org packaging script on 2012-05-25
version = "7.x-1.5"
core = "7.x"
project = "corporateclean"
datestamp = "1337952655"

The issue is caused by typing base theme folder name with different letters than it is written it's folder.

Correct is:
folder: CorporateClean "base theme = CorporateClean"
folder: Corporateclean "base theme = Corporateclean"
folder: corporateclean "base theme = corporateclean"

Incorrect:
folder: CorporateClean "base theme = corporateclean"
folder: corporateclean "base theme = CorporateClean"

tryitonce’s picture

... thanks for taking the time and effort of writing such detail advice here - always appreciated!

One note - I am still struggling with error messages described in this thread, even though following all the advice given here.
I am trying to create a sub-theme for "Simple Clean" = "name = Simple Clean" - project = "simpleclean".
It seems there is a flaw in the simi_id's explanation above - the "base theme" name does not depend on the file name where the base theme is stored - in my case it seems to be the actual name of the theme.
The base theme folder is "simpleclean" but using this in "base theme = simpleclean" my pages goes blank
but with base theme = simple clean (note the blank space between simple and clean I get the themed view - but all those error messages:

Notice: Undefined index: simple clean in drupal_theme_initialize() (line 98 of /var/www/drupal7/includes/theme.inc).
Notice: Trying to get property of non-object in phptemplate_init() (line 12 of /var/www/drupal7/themes/engines/phptemplate/phptemplate.engine).
Notice: Trying to get property of non-object in drupal_alter() (line 1001 of /var/www/drupal7/includes/module.inc).

Any suggestions are welcome on where I am going wrong with this.
.................

iflista’s picture

Paste your theme.info content here or via http://pastebin.com and give me a link.

tryitonce’s picture

Thanks for your help.
I just completed the task with the help of this tutorial - http://www.youtube.com/watch?v=R0i5P3QGm5s
and this one - http://opensourcecms.pro/drupal/howto-drupal-7-sub-theme-creation-step-b....

It all seems to work now and my subtheme .info file looks like this:

scsub.info

name = Simple Clean Sub
description = Simple Clean Sub theme - Tableless, two-column, fixed 960px width theme.
base theme = simpleclean
core = 7.x
engine = phptemplate
stylesheets[all][] = scsub.css

The directory structure is on a multi-site instalation on localhost on Linux Mint 12:
/var/www/drupal7/sites/mysite.com/themes
/var/www/drupal7/sites/mysite.com/themes/simpleclean - base theme folder
/var/www/drupal7/sites/mysite.com/themes/scsub - sub theme folder

Style sheet file scsub.css is empty.

So I need to correct some earlier comments and it seems that the solution lies in getting all the "dots" in the right place.

Peters’s picture

Hi all!

I am having also "some" issues with a sub theme under corporateclean.

Last weeks I have been working -and made changes in- following files:
- corporateclean.info
- page.tpl.php
- style.css
- css folder
- images

These files have to be kept

Now I have tried several combinations to set up a new theme. The theme did appear but the css was not reflected according the latest css file but according to the standard (old) css.
The slideshow, made out of nodes was also not showing.
Nodes were also missing.

Then I wanted to refresh the page and whole became blank! Nothing I could do to change that. So I deleted the new sub theme from the server but still a blank page with no controls whatsoever! :/

Help!

radiobuzzer’s picture

Hi, I followed the above advice, but I am still getting the following error:

Notice: Undefined index: help in include() (line 186 of site_codebase/drupal7wiki/sites/default/themes/sub_corporateclean/page.tpl.php).

iflista’s picture

@Peter, you deleted theme but you had to disable it first. You didn't. You have to add path in your browser "admin/appearance" and disable theme.
@radiobuzzer, remove these lines from .info:
; Information added by drupal.org packaging script on 2012-05-25
version = "7.x-1.5"
core = "7.x"
project = "corporateclean"
datestamp = "1337952655"

rudetrue’s picture

I noticed my sub-theme wasn't displaying properly in some other browsers. To be specific the basic-layout.css and ie.css files weren't being used.

The problem is that they are not inherited from the parent theme. The template.php file has them hard-coded:

function corporateclean_preprocess_html(&$variables) {

        if (!theme_get_setting('responsive_respond','corporateclean')):
        drupal_add_css(path_to_theme() . '/css/basic-layout.css', array('group' => CSS_THEME, 'browsers' => array('IE' => '(lte IE 8)&(!IEMobile)', '!IE' => FALSE), 'preprocess' => FALSE));
        endif;

        drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => '(lte IE 8)&(!IEMobile)', '!IE' => FALSE), 'preprocess' => FALSE));
}

Fixing the issue:

The fix is pretty simple, copy the two files (basic-layout.css & ie.css) to a css folder inside your subtheme, ie: /sites/mysite.com/themes/mysubtheme/css/basic-layout.css
That's it.

As a more permanent solution, template.php should probably be changed:

function corporateclean_preprocess_html(&$variables) {

        if (!theme_get_setting('responsive_respond','corporateclean')):
        drupal_add_css(drupal_get_path('theme', 'corporateclean') . '/css/basic-layout.css', array('group' => CSS_THEME, 'browsers' => array('IE' => '(lte IE 8)&(!IEMobile)', '!IE' => FALSE), 'preprocess' => FALSE));
        endif;

        drupal_add_css(drupal_get_path('theme', 'corporateclean') . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => '(lte IE 8)&(!IEMobile)', '!IE' => FALSE), 'preprocess' => FALSE));
}

Then the files will be found by the sub-theme without any configuration by the user.

rudetrue’s picture

Issue summary: View changes

.