Widgets zones in themes
-
Are widget zones hardcoded?
For example in Persona, we can use right and left widget zones for groups page, but there is no widget declaration via hook.What is the proper way for widget zone registration in custom theme?
-
@administrators guys?
-
They are defined in the theme https://github.com/NodeBB/nodebb-theme-vanilla/blob/master/lib/theme.js#L6
nodebb-theme-vanilla/templates/categories.tpl at master 路 NodeBB/nodebb-theme-vanilla
Vanilla theme for NodeBB based on Bootstrap. Perfect for starting your own NodeBB themes! - nodebb-theme-vanilla/templates/categories.tpl at master 路 NodeBB/nodebb-theme-vanilla
GitHub (github.com)
Not sure if its gonna stay this way though, we want to refactor widget areas for a while now so they are more extendable.
-
@baris ok, that is why I don't understand how it works, persona theme distracts me...
Persona theme, there is no library js to define zones:
https://github.com/NodeBB/nodebb-theme-persona/blob/master/plugin.jsonBut in ACP, you can specify widget zones for Groups' Detail Page.
Where is a magic?Also, for now, if you want to have widget zone in your theme, It's a best practice (define via hook and add div with attribute), isn't it?
-
@Nicolas said:
But in ACP, you can specify widget zones for Groups' Detail Page.
Where is a magic?A very naughty manual add in the admin script:
https://github.com/NodeBB/NodeBB/blob/a054353b6c9896693bfb9c64e7e389380bff1ea1/src/widgets/admin.js#L12-L19