How can I set a target="_new" in a weblink in modx?
I’ve tried using the link attribute field but it doesn’t work....
Help please...
bS
-
MODX Staff
- 730 Posts
Are you using a snippet to output the links in question into your template? Is it Wayfinder? Ditto?
Hi
Im using the wayfinder snippet...
bS
Try adding target="_new" in Link Attributes field.
I have tried this but nothing renders out in the link code, as I expected it would...
???
-
MODX Staff
- 730 Posts
I just wandered through the Wayfinder code, and it definitely looks like it’s meant to make use of Link Attributes.
I recall not being able to get Link Attributes to work a while back. I wonder if the database query isn’t returning the link attribute properly, or if the placeholder replacement isn’t working for some reason. Are you also using PHx?
-
MODX Staff
- 730 Posts
If you’re using a custom template for the rows/links in Wayfinder, did you include the attributes placeholder?
This is Wayfinder’s default template.. see how it has [+wf.attributes+] in the link:
<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
This is so strange?
I checked the wayfinder.inc.php file (assuming this is the correct file?) and indeed found the following line:
<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
But yet i can’t get any code placed inside the link attribute field to render out????
Any ideas?
bS
Found it!
I now realise that the extra chunks I was using for the wayfinder navigation never included the call to the attributes. I was looking too deep into the snippet code!!
Thanks again
bS