XF 2.0 Widget options in template


Active member
I found somewhere that you can put something like this in a template:
<xf:widget class="XF:MembersOnline" opt-limit="50" opt-staffOnline="1" title="Test Online Members" position="sidenav" />
To show a widget with some options.

The questions I have, is this good to use or is it better to use widget key and make different widgets for these keys?

If using this is a good idea, it would be nice to know all options.

I have tried a few for posts and threads:

<xf:widget class="XF:NewThreads" title="Sidebar test" opt-node_ids="3" opt-limit="4" position="sidebar" />

<xf:widget class="XF:NewThreads" title="Threads" opt-node_ids="86" opt-limit="5" />

They work but throws an error for opt-node_ids, what data should it have?

Chris D

XenForo developer
Staff member
It needs to be an array so you would do this:
<xf:widget class="XF:NewThreads" title="Sidebar test" opt-node_ids="{{ [3,86,99,123] }}" opt-limit="4" position="sidebar" />
Where is the adjustment of the height of the widgets, for instance the members online widget height?...when over 10 members are listed the text scrolls off the window, it's not adjusting to the text, so I want to fix the height if I can...


Active member
Thanks @Chris D for the earlier answer, I now have another two questions:

Is there any way to change the widget title link, if I use it for a news forum I would like to link to that forum and not all new threads?

Tried <xf:widget class="XF:NewThreads" title="New" opt-limit="4" /> on a local test server it was very slow 15 s before page was ready. With <xf:widget key="forum_overview_new_posts" /> i was instant?