XF 1.2 Link Forum > links open in new window

Echelon

Active member
Whatever I do......target_blank, target_new, <href......
can't get it done to have the link open in a new window

check visual.

what is the code to have the link open in a new window



link.webp
 

Attachments

  • upload_2013-12-4_10-31-1.webp
    upload_2013-12-4_10-31-1.webp
    32 KB · Views: 39
You don't need to be a coder to learn a basic understanding of HTML. The link I provided explains the anchor tag, its attributes (including target) and even has an example that utilizes it. You posted a screenshot surrounding the correct code, so I'm treating this as a perfect opportunity for you to learn and I have provided all of the resources you need to experiment and get the link working the way you want.
 
You don't need to be a coder to learn a basic understanding of HTML. The link I provided explains the anchor tag, its attributes (including target) and even has an example that utilizes it. You posted a screenshot surrounding the correct code, so I'm treating this as a perfect opportunity for you to learn and I have provided all of the resource you need to experiment and get the link working the way you want.

Ok. I will figure it out. thanks for your help
 
I do know how to add target="_blank" in ordinary html.
But how to add this to a Link Forum?

The field for the URL is then subjected to a script, which surrounds it with the html a href etc, including the quote marks around the actual URL.
So just adding target="_blank" on the end of the URL line does not work (I tried just in case).
Other attempts like inserting the quote marks around the URL to make it more complete, unsurprisingly throw an error.

Above on this thread Jeremy clearly knows this can be done. How please?
 
I do know how to add target="_blank" in ordinary html.
But how to add this to a Link Forum?

The field for the URL is then subjected to a script, which surrounds it with the html a href etc, including the quote marks around the actual URL.
So just adding target="_blank" on the end of the URL line does not work (I tried just in case).
Other attempts like inserting the quote marks around the URL to make it more complete, unsurprisingly throw an error.

Above on this thread Jeremy clearly knows this can be done. How please?

Mike explained it in the second post:
You would need to modify the templates that link to these forums (node_link_level_*).
 
Thanks Jeremy. I got there.
For anyone else not confident on this here's the code:

Go to template node_link_level_2
Count 8 lines down, and insert the blue bit of code where it's shown below.

Rich (BB code):
<div class="nodeInfo linkNodeInfo">
        <span class="nodeIcon"></span>

        <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>      
    </div>

The only drawback is this means that ALL link forums will open the link in a new page.
 
Hello. This works if the link forum is in the node tree but not for the Navigation Bar.

I disabled the link forum and kept it just in the Nav Bar.

Where exactly do i modifiy it? I cant find the correct template for the nav bar links.
 
Hi Guys,
I followed the process and it works, HOWEVER when the link is clicked from the main page it still opens in the same page instead of opening in a new tab

8342da8856.png
 
Top Bottom