XF 2.1 Is possible to add widgets between specific nodes?

Max Fridman

Well-known member
Hello!

I have a question about widgets for Xenforo 2.1, is possible to add them between nodes?

questions.webp

Id like to change the "Guide all'Acquisto Hardware" category forum with a Widget with icons and links to the threads? Is possible to do so? And how?

Thanks for the reply!
 
Add a new Widget in /admin.php?widgets and call/name it "Test_widget_001"
Widgets with no position will not appear anywhere, but you can
call the configured widget instance directly in templates using the
<xf:widget key="Test_widget_001" /> syntax.

1592146870962.png
1592146937715.png
1592147038592.png

Add the following Code to "Template" and hit "save"

Code:
<html>
<head>
<title>NoTitel :(</title>
<style type="text/css">
<!--
h1    {text-align:center; font-family:Arial, Helvetica, Sans-Serif;}
p    {text-indent:20px;}
-->
</style>
</head>
<body bgcolor = "#ffffcc" text = "#000000">
<h1>Hello, World! My first Widget/WebPage is online :)</h1>

<p>You can modify the text in the box to the left any way you like, and
then click the "Show Page" button below the box to display the
result here. Go ahead and do this as often and as long as you like.</p>

<p>You can also use this page to test your Javascript functions and local
style declarations. Everything you do will be handled entirely by your own
browser; nothing you type into the text box will be sent back to the
server.</p>

<p>When you are satisfied with your page, you can select all text in the
textarea and copy it to a new text file, with an extension of
either <b>.htm</b> or <b>.html</b>, depending on your Operating System.
This file can then be moved to your Web server.</p>

</body>
</html>


Edit template the "PAGE_CONTAINER" and there, after Line 36 after "</head>" add: <xf:widget key="Test_widget_001" /> and hit save.

Call your HomepageURL in your Browser or refresh your Startpage...

To undo this, simply delete the <xf:widget key="Test_widget_001" /> line line from the template Page_Container and hit save.
 
Hello!

I have a question about widgets for Xenforo 2.1, is possible to add them between nodes?

View attachment 227401

Id like to change the "Guide all'Acquisto Hardware" category forum with a Widget with icons and links to the threads? Is possible to do so? And how?

Thanks for the reply!


How to use between of categories?

Display in positions options should be not selected because you want to use "Custom".
Like that,

1592148027778.webp

Open to node_list_category template and find the first </xf: macro> add above the code.

Code:
<xf:if is="{$node.node_id} === 1">  <xf:widget key="test_widget" /></xf:if>

You can use with change to the category ID's number (1) wherever you want.
 
I would simply create a page node, add widgets to it and use that page node in
Place of the category (ie as the parent of the forum nodes)

or am I misunderstanding?
 
Top Bottom