Override templates in nodebb-widget-essentials
-
Sure thing, any template you define with the same name and path will override a previously loaded one.
-
@yariplus said in Override templates in nodebb-widget-essentials:
@ethanwu In the ACP plugins menu, there is a button on the right that says "Order Active Plugins". Make sure your plugin is below widget-essentials.
Thanks, I did that. And the console also prints "/widgets/categories.tpl replaced by {my-plugin}".
However, after I restart the server, the templates still remaining unchanged. Is there anything wrong?
-
Oh, sorry about that. Looks like widget-essentials still uses some old code that reads the raw template file without looking for replacements. I'll see if I can get this fixed for you.
-
@yariplus said in Override templates in nodebb-widget-essentials:
Oh, sorry about that. Looks like widget-essentials still uses some old code that reads the raw template file without looking for replacements. I'll see if I can get this fixed for you.
Thanks, can you let me know how. I would love to help on this.
I looked at the plugin, in the
init
method, it seem it directly load from the__dirname
nodebb-widget-essentials/library.js at master · NodeBB/nodebb-widget-essentials
Several basic widgets bundled together in one package including 'HTML', 'Markdown', 'Recent Replies', 'Active Users', and 'Moderators' - nodebb-widget-essentials/library.js at master · NodeBB/nodebb-widget-essentials
GitHub (github.com)
Do you know what should i change to enable it to read from the overridden one?
Thanks,
Ethan -
@ethanwu I just submitted the changes needed here.
nodebb-widget-essentials/library.js at 79b92dd812298689d7d939a2b6e105e4095c2a20 · NodeBB/nodebb-widget-essentials
Several basic widgets bundled together in one package including 'HTML', 'Markdown', 'Recent Replies', 'Active Users', and 'Moderators' - nodebb-widget-essentials/library.js at 79b92dd812298689d7d939a2b6e105e4095c2a20 · NodeBB/nodebb-widget-essentials
GitHub (github.com)
If you want to use it right away, you can just replace the widget-essentials
library.js
file with mine until it is updated. -
@yariplus said in Override templates in nodebb-widget-essentials:
@ethanwu I just submitted the changes needed here.
nodebb-widget-essentials/library.js at 79b92dd812298689d7d939a2b6e105e4095c2a20 · NodeBB/nodebb-widget-essentials
Several basic widgets bundled together in one package including 'HTML', 'Markdown', 'Recent Replies', 'Active Users', and 'Moderators' - nodebb-widget-essentials/library.js at 79b92dd812298689d7d939a2b6e105e4095c2a20 · NodeBB/nodebb-widget-essentials
GitHub (github.com)
If you want to use it right away, you can just replace the widget-essentials
library.js
file with mine until it is updated.Thanks, i will test it today.