MyBB Community Forums

Full Version: "Patches" for templates / CSS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There is a cool little plugin - Patches, but it seems to only address php.

Is there any similar plugin for Templates?
in general, we use template conditionals plugin to insert a template into another template

replies here can be of some help
I understand this. But I mean for minor edits.

For example, if I want to insert "Hello!" after {$header} in the Index template (poor example, but you understand). Or, add some inline CSS.

I want to have these injected into the templates rather than editing the template itself (not entire templates, just minor changes).

I have probably hundreds of these that I did over the years. There's no fixing that now. But say when MyBB 2.0 comes out, or I change themes... and I want to go back and easily see all my changes and selectively edit / reapply to a different template...
You can patch CSS (as in, the actual file created by MyBB) with Patches. You can also patch JavaScript. Basically anything with C /* */ style comments. You'd have to reapply those patches everytime MyBB re-generates the CSS file though.

The patching code in PluginLibrary (which Patches is merely a front-end to) is more generic, it could also patch HTML based templates (different comment style <!-- -->) but this is not in the scope of the Patches plugin itself. You could achieve it in other ways (by patching the template loader) but... well, that's icky.

The idea of Patches is kind of that all core edits are managed with it so you no longer make manual edits. Templates you edit manually all the time. If you change, or remove the /* + */ /* - /* markers that Patches uses to identify changed lines, you'll no longer be able to revert, or reapply patches. So I'm not sure it's suitable for templates at all...
Thank you Frost. Fairly sure we had this conversation a couple years back as well.

I think I will just have to use Notepad++ and compare my modified CSS and templates against the originals from my theme. And this time, log all the changes in case I end up needing to do this again.