Hi,
how I can set option target="_blank" in a new weblink?
Is it possible?
For example I want create a new voice in my menu that is a link to my forum. When I click on forum link from menu, I want open forum in a new window.
Thanks
I’ve been thinking about this myself. I think a worthwhile solution would be to write a plugin that changes all target attributes that have a value of "_blank" into a line of javascript that forces the URL to open in a new window. I’ve played with the idea a little bit...but didn’t get very far.
$modx->makeUrl()
[~[*id*]~]
// check whether it's a reference
if($this->documentObject['type']=="reference") {
// if it's an internal docid tag, process it
if(strpos($this->documentObject['content'],'[~') !== false) {
// generate a url
$this->documentObject['content'] = $this->rewriteUrls($this->documentObject['content']);
}
$this->sendRedirect($this->documentObject['content']);
}
<a href="[~[+id+]~]" [+link_attributes+]>[+menutitle+]</a>

Simple solution, i use this with Ditto but i think it may works for Wayfinder, inside the tpl (&tpl=`name`) code just add the template variable [+link_attributes+]:
This code will activate the field Link Attributes in the Edit Resource area of the Weblink or normal page.
You just need to fill the field with the code target="_blank" if you want to open the link in a blank page, if you don't put anything it will open in the seem window, Ex:
That was a headache for ages, i feel so stupid because the solution was so basic!
hope you use it, and don't spend more time looking for a solution!
Cheers!