Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: Melonking on March 16, 2023, 09:19:49 PM

Title: Theme inheritance?
Post by: Melonking on March 16, 2023, 09:19:49 PM
Is it possible to make themes inherit from each other? I have a theme that's basically identical to another theme but with a few small edits - it would be handy if I could make it inherit from the other in the same way that all themes inherit from the default theme; that would save me having to have unessesery duplicate templates and assets!
Title: Re: Theme inheritance?
Post by: TwitchisMental on March 18, 2023, 11:16:01 AM
Quote from: Melonking on March 16, 2023, 09:19:49 PMIs it possible to make themes inherit from each other? I have a theme that's basically identical to another theme but with a few small edits - it would be handy if I could make it inherit from the other in the same way that all themes inherit from the default theme; that would save me having to have unessesery duplicate templates and assets!
Not that I am aware of.

However that is certainly something that could be talked about as a feature for future releases. I believe MyBB actually has this feature by default.

Edit: With that said, there is the variant system.
Title: Re: Theme inheritance?
Post by: Illori on March 19, 2023, 04:49:58 PM
there is an element for the theme_info.xml file that is <based-on></based-on>.

i am not clear on how this works.

https://wiki.simplemachines.org/smf/Theme-info.xml
Title: Re: Theme inheritance?
Post by: Arantor on March 20, 2023, 02:28:56 PM
It is possible. Generally I'd suggest not because it's fragile, undocumented and few really have a reason to use it.

What specifically do you have in mind? If it is a colour variety, use the variant system instead.