I'm having an awful time sub-theming Basis.  I've followed the guide (the excellent https://backdropcms.org/news/build-sub-theme-basis-default-frontend-them...) and get no where. I'm not new to sub-theming in D7 and have a functional Bootstrap-Lite subtheme running on this dev site, but wow, I can't figure out what's wrong.

Starters - running Mamp-Pro, v 5.7. and Backdrop 1.15, subtheme name is machine friendly "mm_basis", in the site_name/themes directory.  Per another post on theming troubles I disabled the Color module.  And I'm flushing caches all the time.

So if I start with a blank sub-theme, populated with nothing but a mm_basis.info file (per the Ruvalcaba example) I get to select it at admin/appearance and the result is a WSOD.  Add in "base theme = basis" to the .info file and same result.  Add just the skin.css file and call it in .info, WSOD.  Just give up and copy over all the CSS, templates, etc and still WSOD.  Really give up and just copy over the entire Basis directory, rename the directory and .info and still WSOD.   I of course can still get to /admin and reset the theme to Basis.

the Mamp php log just has a cryptic: PHP Fatal error:  Cannot redeclare basis_breadcrumb() (previously declared in /Applications/MAMP/htdocs/site-dev/core/themes/basis/template.php:97) in /Applications/MAMP/htdocs/site-dev/themes/mm_basis/template.php on line 97

I think I've check all the obvious problems ... which are almost entirely naming & file permissions.  Given that I have a working Bootstrap_lite subtheme, clearly MOST of the system is functioning.  Its always some little, stupid thing.  Can anyone point me to the little thing?


You need to rename that function to be namespaced by your new theme `mm_basis`

>Cannot redeclare basis_breadcrumb() (previously declared in /Applications/MAMP/htdocs/site-dev/core/themes/basis/template.php:97) in /Applications/MAMP/htdocs/site-dev/themes/mm_basis/template.php on line 97


so in themes/mm_basis/template.php on line 97 rename basis_breadcrumb() to mm_basis_breadcrumb().

You need to do that with any other `basis_` functions as well.

Well, ok.  I think that really only address the very last attempt in which I duplicated the entire theme and gave up on a sub-theme.

So I edited the template file and changed all "function basis_*" calls to "function mm_basis_*".  Clear caches.

Same WSOD.  Same error...which leads me to verify.  Coda shows the file is edited and saved.  But if I use the terminal ... the file is very different.  So something is wrong with the file system caching.

 Time to figure that out!

BWPanda's picture

Since you were getting  WSOD with just the info file initially, I'd try the suggestions here: https://www.drupal.org/node/158043 to see if you can work out what's causing that before proceeding with sub-theming.

There might be other issues going on here. I recommend also enabling displaying logs to the screen by going to MYWEBSITE.COM/admin/config/development/logging

When I create a child theme of Basis, I start with the very basic setup.

  1. Under /themes/ I create a folder MYTHEME so that I have /themes/MYTHEME.
  2. I add an info file: so I have /themes/MYTHEME/MYTHEME.info.
  3. Then I add this to the .info file:
name = DL Theme
description = A flexible theme built on top of Basis
type = theme
backdrop = 1.x
base theme = basis

Then in MYWEBSITE.COM/admin/appearance I select the new theme. This works for me. No WSOD.

Once you've got the basic setup working you can start adding more things.