2017-12-30, 06:52 AM
2017-12-30, 07:54 AM
in general, we use template conditionals plugin to insert a template into another template
replies here can be of some help
replies here can be of some help
2017-12-30, 08:22 AM
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...
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...
2017-12-30, 03:39 PM
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...
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...
2017-12-31, 12:22 PM
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.
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.