Aloha,
When I edit a weblink (or a page, or a container) in MODx 0.9.5 there’s a field called ’Link attributes’ where I should be able to enter attributes for the link for the page, such as target= or rel=.
Very nice. I can also enter smelly swiss cheese or umpalumpa in this field. Numerous possibilities.
What I was looking for in fact was an easy way to make a ’weblink’ open in a new window, like target="_blank" does in an anchor.
I thought, for a brief moment, the Link attributes field would supply in my needs. Sad enough, it didn’t.
My questions:
- What’s the use of the Link attributes field?
- Does MODx 0.9.5 supply a simple solution for opening a weblink (or the page referred to by the weblink) in a new window?
I stumbled upon some workarounds on this site some time ago but none of them were satisfiying solutions to me.
Thank’s in advance!
-
MODX Staff
- 12,272 Posts
Wayfinder uses link attributes, for which it was originally added.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts
Actually, it was originally specifically created to be able to open weblinks in a new window, since weblinks are often links to pages outside the site, and you may not want the user to actually leave your site. So target="_blank" works beautifully. But... as Ryan says, the menu snippet you are using has to know about that field. Wayfinder does; DropMenu (and perhaps some early versions of Wayfinder) does not.
Replying to a very old topic here.
Sottwell claims that the Link Attributes in the WebLink are the place to add things like target="blank" in the weblink.
But in my MODX version 0.9.6.3 it doesn’t.
Anybody else is using the Link Attributes field in a weblink.
I read the weblink in a WayFinder.
Thanks for your answers,
Bert
-
☆ A M B ☆
- 24,524 Posts
Um... probably because that’s supposed to be target="_blank" (note the underscore) I have corrected my earlier post
You are using the [+wf.attributes+] placeholder in your chunk template, aren’t you?
[+wf.attributes+] -- The link attributes field of the document.
Yep, I changed it to _blank.
And, yes, you are right, I totally overlooked the wf.attributes.
Sorry for that.
Bert