XF 2.0 Open link forum in a new window

abdfahim

Well-known member
Does XF2 have the option to open a link forum in a new window?

In XF1, we had to edit template "node_link_level_2".
 
Edit template: node_list_link_forum

Change ..

PHP:
<xf:macro name="link_forum" arg-node="!" arg-extras="!" arg-children="{$children}" arg-childExtras="{$childExtras}" arg-depth="!">
    <div class="node node--id{$node.node_id} node--depth{$depth} node--link">
        <div class="node-body">
            <span class="node-icon" aria-hidden="true"><i></i></span>
            <div class="node-main js-nodeMain">
                <xf:set var="$descriptionDisplay" value="{{ property('nodeListDescriptionDisplay') }}" />
                <h3 class="node-title">
                     <a href="{{ link('link-forums', $node) }}" data-xf-init="{{ $descriptionDisplay == 'tooltip' ? 'element-tooltip' : '' }}" data-shortcut="node-description">{$node.title}</a>
                </h3>
                <xf:if is="$descriptionDisplay != 'none' && $node.description">
                    <div class="node-description {{ $descriptionDisplay == 'tooltip' ? 'node-description--tooltip js-nodeDescTooltip' : '' }}">{$node.description|raw}</div>
                </xf:if>

                <xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'menu'">
                    <div class="node-meta">
                        <xf:macro template="forum_list" name="sub_nodes_menu"
                            arg-children="{$children}"
                            arg-childExtras="{$childExtras}"
                            arg-depth="{{ $depth + 1 }}" />
                    </div>
                </xf:if>

                <xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'flat'">
                    <xf:macro template="forum_list" name="sub_nodes_flat"
                        arg-children="{$children}"
                        arg-childExtras="{$childExtras}"
                        arg-depth="{{ $depth + 1 }}" />
                </xf:if>
            </div>
        </div>
    </div>

to the following...

PHP:
<xf:macro name="link_forum" arg-node="!" arg-extras="!" arg-children="{$children}" arg-childExtras="{$childExtras}" arg-depth="!">
    <div class="node node--id{$node.node_id} node--depth{$depth} node--link">
        <div class="node-body">
            <span class="node-icon" aria-hidden="true"><i></i></span>
            <div class="node-main js-nodeMain">
                <xf:set var="$descriptionDisplay" value="{{ property('nodeListDescriptionDisplay') }}" />
                <h3 class="node-title">
                     <a href="{{ link('link-forums', $node) }}" data-xf-init="{{ $descriptionDisplay == 'tooltip' ? 'element-tooltip' : '' }}" data-shortcut="node-description" target="_Blank">{$node.title}</a>
                </h3>
                <xf:if is="$descriptionDisplay != 'none' && $node.description">
                    <div class="node-description {{ $descriptionDisplay == 'tooltip' ? 'node-description--tooltip js-nodeDescTooltip' : '' }}">{$node.description|raw}</div>
                </xf:if>

                <xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'menu'">
                    <div class="node-meta">
                        <xf:macro template="forum_list" name="sub_nodes_menu"
                            arg-children="{$children}"
                            arg-childExtras="{$childExtras}"
                            arg-depth="{{ $depth + 1 }}" />
                    </div>
                </xf:if>

                <xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'flat'">
                    <xf:macro template="forum_list" name="sub_nodes_flat"
                        arg-children="{$children}"
                        arg-childExtras="{$childExtras}"
                        arg-depth="{{ $depth + 1 }}" />
                </xf:if>
            </div>
        </div>
    </div>

Essentially adding a target to link forums of _Blank.
 
Here it is! (paid add-on)
 
Back
Top Bottom