Define a widget area in a partial template
-
Good morning.
I just defined a widget area in the
menu.tpl
(partial used inheader.tpl
) callednavbarsearch
with a global scope (all pages). That area is visible in the admin panel, I assigned a dummy html widget to it.theme.js
{ name: 'NavBar Search Area', template: 'global', location: 'navbarsearch', }
partial template:
<div widget-area="navbarsearch" style="background-color: red; flex-grow: 1;"></div>
api output:
"widgets": { "navbarsearch": [ { "html": "<div class=\"well\">Test</div>" } ], ...
The api-output of any page shows the widget contents, but it doesn't get rendered into the widget-area... Did I miss anything?
Best,
Flo -
Widgets are only rendered on the page itself right now https://github.com/NodeBB/NodeBB/blob/master/src/middleware/render.js#L53. We would have to add support so they are rendered in
renderHeader
method as well. Open an issue on our github it could be a nice addition.
Copyright © 2024 NodeBB | Contributors