• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Widget options in template

ge66

Active member
#1
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
#2
It needs to be an array so you would do this:
HTML:
<xf:widget class="XF:NewThreads" title="Sidebar test" opt-node_ids="{{ [3,86,99,123] }}" opt-limit="4" position="sidebar" />