Template:Ifurl: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{#switch:{{lc:{{#titleparts:{{{1|}}}|2}}}}
{{#switch:{{#titleparts:{{{1|}}}|2}}
| ftp:/
| ftp:/
| http:/
| http:/

Revision as of 15:53, 16 February 2012

This template returns one of two arguments, depending on if the first argument is a ftp, http, or https URL. If the scheme is not one of these three, or if the input is not a URL, it returns nothing.

Examples

{{ifurl|http://example.com/foo/bar| true| false}} → false
{{ifurl|https://example.com/foo/bar| true| false}} → false
{{ifurl|foo://example.com/foo/bar| true| false}} → false

See also