Difference between revisions of "Template:SmartLink"

From Wikispooks
Jump to navigation Jump to search
(Created page with "<noinclude>{{WStemplate |categories=String manipulation templates‎ |summary=This template makes a link, but cleans up the linkname first |description=This takes one argument...")
 
Line 2: Line 2:
 
|categories=String manipulation templates‎
 
|categories=String manipulation templates‎
 
|summary=This template makes a link, but cleans up the linkname first
 
|summary=This template makes a link, but cleans up the linkname first
|description=This takes one argument, the text to make a link out of. It is 'smart', in that it does the followiong operation:<br/>
+
|description=This takes one argument, the text to make a link out of. It calculates the anchortext by using [[Template:SmartLink/Anchor]].
* It removes a trailing "?" from the pagename (to allow people to end links in "?" to indicate uncertainty
 
 
}}
 
}}
</noinclude><includeonly>{{#if: {{{1|}}}} | {{#ifeq: {{#substring:{{{1|}}}|-1}}|?|[[{{#sub:{{{1}}}|0|-1}}|{{{1|}}}]]| [[{{{1|}}}]] }} }}</includeonly>
+
</noinclude><includeonly>{{#if: {{{1|}}} | [[{{SmartLink/Anchor|{{{1|}}}}}|{{{1}}}]]}}</includeonly>

Revision as of 02:26, 14 March 2016

This template makes a link, but cleans up the linkname first
This takes one argument, the text to make a link out of. It calculates the anchortext by using Template:SmartLink/Anchor.

Blue parameters are for a single Wikispooks page name (If no suitable page exists, then pick a title for a future page)
Brown parameters are for numbers
Green parameters are for comma-separated lists of page names (Or planned page names).
Navy parameters are for dates
Orange parameters are for booleans. (Usually, either "Yes" or just leave blank).
Purple parameters are URLs.
Violet parameters are slash-separated lists.
Pink parameters are for coordinates.
Crossed out parameters were formerly available, but have been upgraded. Some may still work, but do not use these.