Hey all,
So I am looking to begin learning some theming by modifying Garland, and so I started by copying it into the sites/all/themes/MyTheme directory. Unfortunately this broke everything. :) Every page I am getting the following:
Notice: Undefined variable: site_name_and_slogan in include() (line 14 of C:\Program Files\\WMA\sites\all\themes\MyTheme\mytheme\page.tpl.php).
Notice: Undefined variable: site_name_and_slogan in include() (line 14 of C:\Program Files\\WMA\sites\all\themes\MyTheme\mytheme\page.tpl.php).
Notice: Undefined variable: site_html in include() (line 16 of C:\Program Files\\WMA\sites\all\themes\MyTheme\mytheme\page.tpl.php).
Notice: Undefined variable: primary_nav in include() (line 29 of C:\Program Files\\WMA\sites\all\themes\MyTheme\mytheme\page.tpl.php).
Notice: Undefined variable: secondary_nav in include() (line 30 of C:\Program Files\\WMA\sites\all\themes\MyTheme\mytheme\page.tpl.php).
While searching for a solution I found one suggestion changing all references to "garland" in template.php to "mytheme" (which is the new name I gave the site in MyTheme.info).
In addition to the errors, I lost my color scheme (which is not really a big issue) and the width of my columns got all messed up (the left and right bars used to be on the far left and right, now they've moved inwards, sort of squishing the main content area).
Any help with dealing with this would be greatly appreciated. I'm sure it's just some silly change I forgot to make, but I'm having a hard time figuring out what that change may be.
Thanks,
-Keilan
Comments
Hopefully I have waited long
Hopefully I have waited long enough for this bump to be acceptable. I'm still grappling with these errors, the fixes I've found online have either been confusing or ineffective. If I need to give more details or be more clear, let me know. :)
Surprised
These secondary variables that Garland generates are from the template.php file. I had a hunch and after much todo I renamed the functions to match my theme name (i.e. mygarland_width). I did this across the theme on all files. Do a find/replace for garland and replace with your theme name.
Example (where mygarland is the theme name):
function garland_breadcrumb($variables) { --------- becomes
function mygarland_breadcrumb($variables) {
Flush your cache and clear your browser cache. This worked for me; much to my joy as I have not found a single good answer to this question. As if copying a core theme was somehow a sin or something :)
## Note: The above code is fictitious. Any resemblance to real or actual working code is purely coincidental.
exactly
This is exactly what happened to me and now I'm being told I have merely cloned the theme and not created a sub theme.
In the end what does it matter if all is saved in sites folder for back up?
=-=
it matters as has been explained before because when the cloned theme is updated by the mainatiner your theme won't get those updates.
I know this is an older thread, but this is important:
again:
a schoolmasterly unhelpful and exposing utter ignorance glossed over by faking knowledge through repitition of manual texts, with no help, the only reason being to put down a newcomer asking a question:
as this clearly shows, the programming of Drupal is not context free: a theme is not an entity with a branched off and properly inherited environment:
If I would write my own theme from scratch and by chance name a function or variable the same as in a different default theme then that theme would take over, as this involuntary experiment shows: he had to rename everything: function names and varaible names, although it was declared as being a new theme, in its own theme folder.
I found already that the Drupal database is not normalized, and that things are actually 'programmed into the database', look at the language ie... issue: they are column names!!!!!!!!!!!!!!
As most of the open source stuff, there is a core of very dedicated people who start things in a very good manner, with very good intentions.
Then comes the clueless mob 'participating': the sea of ego maniacs and psychos who have
no clue of testing, writing code, designing databases, and 'contribute' a mess to something that could have been great.
Unhelpful, schoolmastering reply styles are very frequent, like VMs exploits, who then states as a justification for his failure a very non-sensical "reason" for his failed replies:
when you branch off a theme from a different one you won't get the updates to the original one.
Well, this shows clearly the type of people VM represents:
no clue
if I branch something off I lose changes to the master branch and have to merge either automatically or manually: any beginner developer knows that.
This last answer of VM shows that he has absolutely no clue about development of anything!
Moderators should have picked up on this and removed his privilege of answering to questions.
Putting down newbies:
every day we venture into new things (if we are active in any way, shape, or form), which makes us a newbie in at least one thing daily.
As a newcomer to anything, I do have a right to be welcomed and helped, this is the spirit of open source.
These little iddly piddly schoolmasters who defend their little pretend-knowlege against others and try to make themselves 'something' by putting others down, stating the obvious, or sending them to general manual places instead of helping the particular case (with the patronizing pretext of "you should not do this"...), are putting down newcomers, and violating the spirit of open source.
Yep, you dont' like what you read here.
But it seems the mob rule has taken over also Drupal, the dumb mob of them little ego maniacky psychos...
Mike (no pretend anonymizing, I stand behind what I say: I am throwing a life preserver to this community: get back to the original spirit, or that entire 'open source' thing will go down as an example of a mass psychosis)