Difference between revisions of "Template:Mailto"

m
Line 1: Line 1:
 
<noinclude>This template simplifies the addition of clickable email addresses to a page.  It takes one to three parameters, as follows:
 
<noinclude>This template simplifies the addition of clickable email addresses to a page.  It takes one to three parameters, as follows:
  
* The first parameter is the local part of the email address.  It's the only required parameter.  If no other parameters are supplied, it assumes the domain is "cs.jhu.edu". e.g. <code><nowiki>{{mailto|support}}</nowiki></code> → {{mailto|support}}
+
* The first parameter is the local part of the email address.  It's the only required parameter.  If no other parameters are supplied, it assumes the domain is "cs.jhu.edu".
* The second parameter gives alternate text to display instead of the email address. e.g. <code><nowiki>{{mailto|steve|Steve DeBlasio}}</nowiki></code> → {{mailto|steve|Steve DeBlasio}}
+
** <code><nowiki>{{mailto|support}}</nowiki></code> → {{mailto|support}}
* The third parameter gives an alternate domain. e.g. <code><nowiki>{{mailto|pgold3|Phil Gold|jhu.edu}}</nowiki></code> → {{mailto|pgold3|Phil Gold|jhu.edu}}
+
* The second parameter gives alternate text to display instead of the email address.
** If you want to change the domain without providing alternate link text, use the third parameter's name, "domain". e.g. <code><nowiki>{{mailto|pgold3|domain=jhu.edu}}</nowiki></code> → {{mailto|pgold3|domain=jhu.edu}}
+
** <code><nowiki>{{mailto|steve|Steve DeBlasio}}</nowiki></code> → {{mailto|steve|Steve DeBlasio}}
 +
* The third parameter gives an alternate domain.
 +
** <code><nowiki>{{mailto|pgold3|Phil Gold|jhu.edu}}</nowiki></code> → {{mailto|pgold3|Phil Gold|jhu.edu}}
 +
* If you want to change the domain without providing alternate link text, use the third parameter's name, "domain".
 +
** <code><nowiki>{{mailto|pgold3|domain=jhu.edu}}</nowiki></code> → {{mailto|pgold3|domain=jhu.edu}}
 
</noinclude><includeonly>[mailto:{{{1}}}@{{{3|{{{domain|cs.jhu.edu}}}}}} {{{2|{{{1}}}@{{{3|{{{domain|cs.jhu.edu}}}}}}}}}]</includeonly>
 
</noinclude><includeonly>[mailto:{{{1}}}@{{{3|{{{domain|cs.jhu.edu}}}}}} {{{2|{{{1}}}@{{{3|{{{domain|cs.jhu.edu}}}}}}}}}]</includeonly>

Revision as of 19:15, 23 January 2020

This template simplifies the addition of clickable email addresses to a page. It takes one to three parameters, as follows:

  • The first parameter is the local part of the email address. It's the only required parameter. If no other parameters are supplied, it assumes the domain is "cs.jhu.edu".
  • The second parameter gives alternate text to display instead of the email address.
  • The third parameter gives an alternate domain.
    • {{mailto|pgold3|Phil Gold|jhu.edu}}Phil Gold
  • If you want to change the domain without providing alternate link text, use the third parameter's name, "domain".