1084

Open in new tab with anchor()

Comments for “Open in new tab with anchor()”
 

Posted by MKnights on Monday 14th March 2022 at 17:22 GMT

I am trying to get the anchor() function to open a link in a new tab.
I can see there are inputs for attributes and additional code, but I could find the documentation on how to use them.
anchor($target_url, $text, $attributes=NULL, $additional_code=NULL)

I want to open the link in a new tab; target="_blank" I know like most things it will be easy once I know how but I have not been able to figure it out.
Founding Member

MKnights

User Level: Founding Member

Date Joined: 19/11/2018

Posted by djnordeen on Monday 14th March 2022 at 20:47 GMT

Hello,
From the docs.
https://trongate.io/docs_m/information/other-helpful-features

anchor($target_url, $text, target="_blank", $additional_code=NULL)


Hope this helps,
Dan

This comment was edited by djnordeen on Monday 14th March 2022 at 20:53 GMT

Early Adopter

djnordeen

User Level: Early Adopter

Date Joined: 20/08/2021

Posted by DaFa on Tuesday 15th March 2022 at 05:51 GMT

Dan is on the right path, but the above code will cause an error.

The anchor method is expecting an array for the 3rd parameter, like so:

anchor("https://trongate.io/", "Trongate", array("target" => "_blank"))

This comment was edited by DaFa on Tuesday 15th March 2022 at 05:53 GMT

Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by MKnights on Tuesday 15th March 2022 at 09:11 GMT

Thanks, I knew it would be simple.
Founding Member

MKnights

User Level: Founding Member

Date Joined: 19/11/2018

×