Ignore me. The docs answer my question:
Run grunt to start up NodeBB and watch for code changes.
This is a new feature that is coming in 1.6.1, previously html widgets were just static. Now you can use them like any template. For example here is a sample html widget placed on category.tpl sidebar.
Now when you visit the
General Discussion category it looks like this:
If you visit
Announcements Category it looks like this:
You can use any benchpressjs(templates.js) syntax, and any data that is avaiable in
ajaxify.data. You can see the variables available by opening up your browser console and typing
Another cool feature this allows is letting plugins add custom data into pages and then utilizing that in widgets. By using the hooks
filter:middleware.render you can add data into the page and the widget will have access to the same data.
Hope this helps customise your NodeBB even further!
I've wanted this for so long...
@djensen47 can you give some more details? What page are you looking at etc
I'm trying to insert some template data into an html widget. I'm currently looking at the homepage while testing this.
.... oh. But I'm still not sure how to get the user data like username.
ajaxify.data.loggedInUser.username would be
loggedInUser.username in the template context.
@PitaJ That didn't seem to work. On the home page (list of categories)
ajaxify.data shows up as:
The only page (so far) that this seems to work on is a topic page.
@djensen47 oh, huh. Appears
loggedInUser isn't defined on the home page (/category listing). Odd. In that case, you'll have to provide that data yourself by hooking into
filter:<abc>.render or adding the info to the widget itself.
Otherwise you'll have to bug us to add that into core.
@djensen47 Not at this time AFAIK