somebody. I tried to use a weblink resource (which gets an" /> somebody. I tried to use a weblink resource (which gets an" /> somebody. I tried to use a weblink resource (which gets an"/>

How do I create a reusable mailto link in ModX?

249 views Asked by At

I want to create a link to an email address like <a href="mailto:[email protected]">somebody</a>.

I tried to use a weblink resource (which gets an id of 20) with mailto:[email protected] as link value and render this in my content with the tag [[~20?~]]. (and different variations of it)

But ModX renders it as <a href="index.php?id=20">somebody</a> This is not what I want.

So how do I do this properly, so that I can reuse this resource in several places in the website?

This link needs to be editable for a 'Content editor' with reduced rights, so I don't think a chunk is the best way to go.

1

There are 1 answers

1
Vasis On BEST ANSWER

Because to do this you need to create weblink:

enter image description here

enter image description here

and this is works as expected in Wayfinder/PdoMenu:

enter image description here

UPDATE: [[~20]] - will output alias field. You need to output content field. To do this use pdoField snippet (part of pdoTools):

[[pdoField?&id=`20`&field=`content`]]