Difference between revisions of "Template:Citation/make link"

From Self-sufficiency
Jump to: navigation, search
(Comments made no difference so go back to older version.)
(add check if #titleparts does anything)
Line 1: Line 1:
{{#switch:{{#titleparts:{{{1|}}}|2}}
+
{{#switch:{{#titleparts:{{lcfirst:{{{1|}}}}}|2}}
|Http:/|Https:/|Ftp:/ = [{{{1}}} {{{2}}}]
+
 
  |<!--if empty-->|None = {{{2}}}
 
  |<!--if empty-->|None = {{{2}}}
 +
|Http:/|Https:/|Ftp:/|{{lcfirst:{{{1|}}}}} = [{{{1}}} {{{2}}}]
 
  |#default            = [[:{{{1}}}|{{{2}}}]]
 
  |#default            = [[:{{{1}}}|{{{2}}}]]
 
}}<noinclude>
 
}}<noinclude>
Line 13: Line 13:
 
     not about a book or chapter.
 
     not about a book or chapter.
 
   4. The colon in "[[:" prevents images from being expanded.
 
   4. The colon in "[[:" prevents images from being expanded.
 +
  5. The lcfirst checks if #titleparts does anything. That is, if the result
 +
    of #titleparts has a lowecase first letter, then #titleparts passed through
 +
    the parameter unchanged, meaning the string was not a valid article title.
 
-->
 
-->
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 00:14, 2 August 2009

{{{2}}}