1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. 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

Discussion in 'Template Modifications [Archive]' started by borbole, Oct 10, 2010.

  1. borbole

    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>
     
  2. Shelley

    Shelley Well-Known Member

    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 :)
     
    borbole likes this.
  3. borbole

    borbole Well-Known Member

    I agree. That would be a nice feature to have. Thank you for your feedback :)
     
  4. Rob

    Rob Well-Known Member

    Isn't target depreciated in html 5?
     
  5. borbole

    borbole Well-Known Member

    Yes it is. But that is the easiest way to make them open in a new tab.
     
  6. Rob

    Rob Well-Known Member

  7. borbole

    borbole Well-Known Member

  8. Rob

    Rob Well-Known Member

    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
     
    [PixeL] likes this.
  9. borbole

    borbole Well-Known Member

    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 :)
     
  10. Shadab

    Shadab Well-Known Member

    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)
     
    Rob and borbole like this.
  11. borbole

    borbole Well-Known Member

  12. Rob

    Rob Well-Known Member

    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 :)
     
  13. Travis

    Travis Active Member

    Preview?
     
  14. borbole

    borbole Well-Known Member

    Do you mean a screenshot? If so, I don''t think it is possible. As it says, it makes the forums that serve as links to open in a new tab.
     
  15. lms

    lms Well-Known Member

    Gracias por el mod.

    Thanks for the mod.

    Salud2
     
    borbole likes this.
  16. Netsultants

    Netsultants Active Member

    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>
     

Share This Page