News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Theme inheritance?

Started by Melonking, March 16, 2023, 09:19:49 PM

Previous topic - Next topic

Melonking

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!

TwitchisMental

#1
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.

Illori

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

Arantor

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.

Advertisement: