Is there a way to keep Drupal's base theme css inheritance while using theme key to apply a sub theme on specific urls ?

CommentFileSizeAuthor
#7 child.info720 bytesstilllife00

Comments

mkalkbrenner’s picture

Sorry, I think I don't understand the question.
Can you be more specific or do an example?

stilllife00’s picture

I have a theme, lets say MAINTHEME and then I have a subtheme of it, lets say CHILD. I would like to use ThemeKey to load CHILD only on some pages of the website and use MAINTHEME on the other, but I also would like to keep the inheritance of the css so the css of MAINTHEME are used by CHILD either.

Now it happens that CHILD is the only theme loaded in that pages, so no css from MAINTHEME, that is not what happens with Drupal by default...

Thanks

mkalkbrenner’s picture

That sounds like a bug.
What happens if you use CHILD as default theme without ThemeKey?

stilllife00’s picture

It works correctly inheritting css' from the MAINTHEME

mkalkbrenner’s picture

I'll do a test ...

mkalkbrenner’s picture

Can you post the .info file of CHILD?

stilllife00’s picture

StatusFileSize
new720 bytes

On attachment

mkalkbrenner’s picture

Seems like .info is not allowed for attachments ;-)

Please simply post the content.

stilllife00’s picture

name = Child
Base theme = maintheme
description = blabla
package = Core
version = VERSION
core = 7.x

stylesheets[all][] = css/vacancie.css

regions[header] = Header
regions[languagesw] = Languagesw
regions[navbar] = Navigation bar

regions[content] = Content
regions[search] = Search
regions[filter] = Filter

regions[sidebar_left] = Sidebar left

regions[logo1] = Logobar

regions[footer] = Footer
regions[f-aboutus] = Footer about us
regions[f-departments] = Footer departments
regions[f-contact] = Footer contact
regions[f-disclaimer] = Footer Disclaimer

; Information added by drupal.org packaging script on 2011-01-05
version = "7.0"
project = "drupal"
datestamp = "1294208756"

stilllife00’s picture

Status: Closed (works as designed) » Active

Your comments made me think and I got the issue. I changed the info file adding

engine = phptemplate

and removing the optional lines like version =

And remember to clear the theme AND css cache

Now is working! thanks

stilllife00’s picture

Status: Active » Closed (works as designed)
mkalkbrenner’s picture

It would be interesting to know what solved the issue exactly:
1. engine = phptemplate
2. removing the optional lines like version =
3. clear the theme AND css cache

1. and 2. will indicate a minor bug in drupal core.
3. will indicate a minor bug in ThemeKey, because we already clear the caches when the rules are saved.

Are you able to reproduce the issue?

stilllife00’s picture

The
engine = phptemplate
solved the issue but I don't think its a drupal bug since the documentation says that that line is compulsory, so was my fault (old files without the proper lines, maybe a copy paste from old code...)

The theme and css refresh was needed after (re)inserting that line ofcourse, I just forgot to refresh the CSS cache the first time so I wrote it here so people avoid to make the same mistake

mkalkbrenner’s picture

Thank you for the clarification.

Can you point me to the corresponding part of the documentation?

I guess that that line is compulsory for the parent theme, but maybe not for the child.

stilllife00’s picture

http://drupal.org/node/171205#engine it says required in most cases

mkalkbrenner’s picture

Note that in Drupal 7, this line is no longer necessary because PHPTemplate is assumed by default.

For me it sounds like a bug. The assumption doesn't seem to work if the theme is set using hook_custom_theme()

mkalkbrenner’s picture

Title: With themekey there' s no base theme css inheritance » theme inheritance seems to crash if theme is selected by hook_custom_theme and "engine" is missing in theme.info file
Project: ThemeKey » Drupal core
Version: 7.x-2.3 » 7.x-dev
Component: Code / API » theme system
Category: support » bug
Priority: Normal » Minor

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.