Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Out of the box, Responsive Blog is not subtheme-friendly. In part, page.tpl.php uses theme_get_setting(setting, 'responsive_blog') for all settings, which means the options must be set for the base theme instead of the subtheme.
I'm using a subtheme to get the benefits of a custom stylesheet. Please consider making this theme friendly to subthemes.
Comment | File | Size | Author |
---|---|---|---|
#3 | sub_theme_friendlier.diff | 17.99 KB | yettyn |
Comments
Comment #1
rols CreditAttribution: rols commentedA possible workaround is to copy the theme settings into your subthemes .info file. Then copy theme-settings.php to your subtheme and rename the function to
your_theme_name_function_form_system_theme_settings_alter(&$form, &$form_state)
and replace any instance of
theme_get_setting('setting_name','responsive_blog')
totheme_get_setting('setting_name','your_theme_name'
in page.tpl.php e.t.c.Comment #2
yettyn CreditAttribution: yettyn commentedI'm no expert on themeing but after looking at the code of a few themes I think there are 2 basic problems here. First of all I suspect it's a bad design decision to use theme_get_setting() at several places as in page.tpl.php where available variables could be used instead, $logo being one example.
Secondly, I suspect it's also a bad design decision to hard code the theme name as 2nd argument to theme_get_setting(), because if not given the current theme will automatically be used. So my take is it's there if in case for any reason the call needs to refer to a different theme than the current one in use.
Well that's my theory at least, so now time to test it in practice as I'd like to use this as a sub-theme as well in a multi-site environment, rather than fork my own copy of it - in case the author decides to give it more love. If my theory is correct I will post a patch.
The code above may work but is basically also a bad solution because it forces you to maintain code unnecessarily in case of updates to the base theme.
Comment #3
yettyn CreditAttribution: yettyn commentedHere is a diff with the changes I have done to make the theme much more sub-theme friendlier, actually works more or less out of the box I think. Works fine with just a basic sub-theme.info and logo.png file and will also sense if sub-theme has own color-schemes.css, slideshow images, even < > images or a modified slide.js file. No need to put any of the tpl.php in the sub-theme, but it should work if you want to. But please test as I haven't do that much testing so there may be glitches.
I couldn't make any patch as I don't have git, but if anyone else like to make it into a patch feel welcome.
Comment #3.0
yettyn CreditAttribution: yettyn commentedUsing HTML tags instead of BBCode.
Comment #4
authentictech CreditAttribution: authentictech commentedThanks yettyn for providing the solution. I can confirm it works for me.
It would be nice if the theme maintainer could implement this fix, particularly as the work has already been done. It's been over a year now... Thanks.
Comment #5
authentictech CreditAttribution: authentictech commentedSub-theming is the Drupal way. This should work so changing the issue to a bug report.
Comment #6
sillygwailoI can get behind this, though I'd want to include this after #3101081: Add "Use system setting" option for dark theme lands, which would mean some slight modifications to the patch here.