• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Forum Links In New Tabs

borbole

Well-known member
This will make that all the forums that you will turn into redirected links, to open in a new window. I saw it being requested at a thread here.

Anyway, find the following code at the node_link_level_2 template.

Code:
<div class="nodeText">
<h3 class="nodeTitle"><a href="{xen:link link-forums, $link}" data-description-x="#nodeDescription-{$link.node_id}">{$link.title}</a></h3>
<xen:if is="{$link.description}"><blockquote class="nodeDescription muted baseHtml" id="nodeDescription-{$link.node_id}">{xen:raw $link.description}</blockquote></xen:if>
</div>

And change it to:

Code:
<div class="nodeText">
<h3 class="nodeTitle"><a href="{xen:link link-forums, $link}" target="_blank" data-description-x="#nodeDescription-{$link.node_id}">{$link.title}</a></h3>
<xen:if is="{$link.description}"><blockquote class="nodeDescription muted baseHtml" id="nodeDescription-{$link.node_id}">{xen:raw $link.description}</blockquote></xen:if>
</div>
 
I've suggested this before but it would be nice if somehow we can get some kind of counter on the right hand side showing how many people have been redirected to that link. :) anyway. nice work and thanks :)
 
Don't take this the wrong way but I think all mods should output valid HTML - this breaks xenForo's validation. I am quite suprised you don't want to fix it in fact given that you offer forum services. Will all your services output code from 2005?

[edit]Apologies, I just noticed this is a template modification, not a mod
 
Don't take this the wrong way but I think all mods should output valid HTML - this breaks xenForo's validation. I am quite suprised you don't want to fix it in fact given that you offer forum services. Will all your services output code from 2005?

[edit]Apologies, I just noticed this is a template modification, not a mod

I am not taking this the wrong way and I am all for valid HTML but I think that you are making a mountin out of a molehill. And this was made on the fly as already explained above and not part of my forum services at all btw :)
 
Isn't target depreciated in html 5?
Yes it is. But that is the easiest way to make them open in a new tab.
Not anymore :). The latest working drafts on HTML5 (published as well as non-published) don't list target as a deprecated attribute. In fact, the base element now supports the target attribute too. (status given in 3rd link below)
 
Not anymore :). The latest working drafts on HTML5 (published as well as non-published) don't list target as a deprecated attribute. In fact, the base element now supports the target attribute too. (status given in 3rd link below)
Well I never...

I'm so pleased this got added back!! I always wondered in fact why they removed it!

All's well that ends well :)
 
Most probably want to change this code as well: This will open the link in a new window if the link is clicked in the forum drop down menu.

find the following code at the node_link_level_n template.

Change:

Code:
<h4 class="nodeTitle"><a href="{xen:link link-forums, $link}" class="menuRow">{$link.title}</a></h4>

to:

Code:
<h4 class="nodeTitle"><a href="{xen:link link-forums, $link}" target="_blank" class="menuRow">{$link.title}</a></h4>
 
Top Bottom