Template

Link: Difference between revisions

No edit summary
(Don't show drawer if archive/natarchive exists)
 
Line 50: Line 50:
Archive icon linking to Archive.org search, if no archive link exists (this only works if url exists...)
Archive icon linking to Archive.org search, if no archive link exists (this only works if url exists...)
//-->{{#if:{{{archive|}}}{{{natarchive|}}}||{{#if:{{{url|}}}|&#32;<span class="archive-search-icon">[https://web.archive.org/web/*/{{{url}}} <i class="fa fa-university" title="This links to the Internet Archive search page"></i>]</span>}} }}<!--
//-->{{#if:{{{archive|}}}{{{natarchive|}}}||{{#if:{{{url|}}}|&#32;<span class="archive-search-icon">[https://web.archive.org/web/*/{{{url}}} <i class="fa fa-university" title="This links to the Internet Archive search page"></i>]</span>}} }}<!--
Show cloud (to download) or drawer (note about saved files) icon
Show cloud (to download) or drawer (note about saved files) icon. NB don't show drawer if archive/natarchive exists!
//-->{{#if:{{{file|}}}|&#32;<span class="plainlinks">[{{SERVER}}/media/{{urlencode:{{{file}}}|WIKI}} <i class="fa fa-cloud-download" title="If the external link is dead: you can download this document directly from MHLO"></i>]</span>
//-->{{#if:{{{file|}}}|&#32;<span class="plainlinks">[{{SERVER}}/media/{{urlencode:{{{file}}}|WIKI}} <i class="fa fa-cloud-download" title="If the external link is dead: you can download this document directly from MHLO"></i>]</span>
| {{#if:{{{saved|}}}|&#32;<span class="saved-icon">[{{SERVER}}/Mental_Health_Law_Online:Saved_documents <i class="fa fa-archive" title="If the external link is dead: contact me and I will send you my copy"></i>]</span>}} }}<!--  
| {{#if:{{{saved|}}}|{{#if:{{{archive|}}}{{{natarchive|}}}||&#32;<span class="saved-icon">[{{SERVER}}/Mental_Health_Law_Online:Saved_documents <i class="fa fa-archive" title="If the external link is dead: contact me and I will send you my copy"></i>]</span>}} }} }}<!--  
Next bit repeats the above options for 3rd unnamed parameter which could be either
Next bit repeats the above options for 3rd unnamed parameter which could be either
//-->{{#if:{{{3|}}}|{{#switch:{{{3}}}
//-->{{#if:{{{3|}}}|{{#switch:{{{3}}}
| s
| s
| z = &#32;<span class="saved-icon">[{{SERVER}}/Mental_Health_Law_Online:Saved_documents <i class="fa fa-archive" title="If the external link is dead: contact me and I will send you my copy"></i>]</span>  
| z = {{#if:{{{archive|}}}{{{natarchive|}}}||&#32;<span class="saved-icon">[{{SERVER}}/Mental_Health_Law_Online:Saved_documents <i class="fa fa-archive" title="If the external link is dead: contact me and I will send you my copy"></i>]</span>}}
| #default = &#32;<span class="plainlinks">[{{SERVER}}/media/{{urlencode:{{{3|}}}|WIKI}} <i class="fa fa-cloud-download" title="If the external link is dead: you can download this document directly from MHLO"></i>]</span>
| #default = &#32;<span class="plainlinks">[{{SERVER}}/media/{{urlencode:{{{3|}}}|WIKI}} <i class="fa fa-cloud-download" title="If the external link is dead: you can download this document directly from MHLO"></i>]</span>
}} }}</includeonly>
}} }}</includeonly>

Latest revision as of 21:50, 19 November 2022

Old way New way
Link {{link|http://www.duck.com|Duck}}
Duck
{{link|url=http://www.duck.com|text=Duck}}
Duck
Saved (s or z) {{link|http://www.duck.com|Duck|s}}
Duck
{{link|url=http://www.duck.com|text=Duck|saved=s}}
Duck
File {{link|http://www.duck.com|Duck|Duck.pdf}}
Duck
{{link|url=http://www.duck.com|text=Duck|file=Duck.pdf}}
Duck
Internet Archive N/A {{link|url=http://www.duck.com|text=Duck|archive=https://www.archive.org}}
Duck
National Archives N/A {{link|http://www.duck.com|Duck|natarchive=https://webarchive.nationalarchives.gov.uk}}
Duck
No/dead link N/A {{link|deadurl=http://www.duck.com|text=Duck}} (i.e. just no url parameter)
Duck

Could be combination, e.g.

  • {{link|deadurl=http://www.duck.com|text=Duck|archive=https://www.archive.org}} Duck
  • {{link|url=http://www.duck.com|text=Duck|file=Duck.pdf|natarchive=https://www.archive.org}} Duck
  • {{link|url=http://www.duck.com|text=Duck|file=Duck.pdf|natarchive=https://www.archive.org|saved=s}} Duck
  • {{link|deadurl=http://www.duck.com|text=Duck|archive=https://www.archive.org|natarchive=http://www.gov.uk}} Duck
  • {{link|text=Duck|archive=https://www.archive.org|saved=s}} Duck