Thanks guys, that worked.
Solved 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
https://github.com/NodeBB/nodebb-theme-vanilla/blob/master/templates/categories.tpl#L62
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 said:
Not sure if its gonna stay this way though, we want to refactor widget areas for a while now so they are more extendable.
Please, this is all I want for christmas.
-
@psychobunny has wanted to re-do the widgets for quite awhile so it's on his radar.
@baris and I were ok with the existing system
. I personally have no idea what he has in mind...
-
@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?
-
Correct, the only way to define a widget area is to add the div with attribute, and then define a plugin listener to register it with NodeBB.
-
@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 -
@nicolas search for theme exodus.its persona fork with widgets, it not finished but it can help you to see the code