XF 2.0 Link Forum - Open In New Tab

To accomplish this, you can edit the node_list_link_forum template:

Find this line:

HTML:
                     <a href="{{ link('link-forums', $node) }}" data-xf-init="{{ $descriptionDisplay == 'tooltip' ? 'element-tooltip' : '' }}" data-shortcut="node-description">{$node.title}</a>

And replace it with the following:

HTML:
                     <a href="{{ link('link-forums', $node) }}" data-xf-init="{{ $descriptionDisplay == 'tooltip' ? 'element-tooltip' : '' }}" data-shortcut="node-description" target="blank_">{$node.title}</a>

Link forums will now open in a new tab.
 
HTML:
<a href="{{ link('link-forums', $node) }}" data-xf-init="{{ $descriptionDisplay == 'tooltip' ? 'element-tooltip' : '' }}" data-shortcut="node-description" target="blank_">{$node.title}</a>
This works great when I click on the link here

1643584625327.webp

How can I get it to work in the node list?

1643584649885.webp

Thanks
 
I agree this would be nice to know. @Brogan could you offer any insight into this for us, if possible please? We would like to make link forums clicked on from the node list to open in a new window but don't want to mess with code randomly... so wanted to ask. Thank you!
 
Template: node_list_link_forum

Find:
Code:
<a href="{{ link('link-forums', $node) }}" class="subNodeLink subNodeLink--link">{$node.title}</a>

Replace with:

Code:
<a href="{{ link('link-forums', $node) }}" class="subNodeLink subNodeLink--link" target="_blank">{$node.title}</a>

This should cover that area. This will change all link type nodes in this area just as a heads up.
 
Top Bottom