Define a widget area in a partial template

  • Good morning.

    I just defined a widget area in the menu.tpl (partial used in header.tpl) called navbarsearch with a global scope (all pages). That area is visible in the admin panel, I assigned a dummy html widget to it.


    	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?


  • Admin

    Widgets are only rendered on the page itself right now 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.



Looks like your connection to NodeBB was lost, please wait while we try to reconnect.