Template:Compare: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Zai Lynch (talk | contribs)
m further improvement so it can be passed in #if conditional instead of another #ifeq call
Zai Lynch (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
<onlyinclude><includeonly>{{#ifeq:{{#titleparts:{{{1|}}}}}|{{#titleparts:{{{2|}}}}}|1|}}</includeonly></onlyinclude>This template compares to strings, returns 1 when they are equal and an empty string otherwise. It is supposed to be used to comapare a string with a pagename, since they got different ways to encode apostrophs. It can be passed in a #if parser function.
<onlyinclude><includeonly>{{#ifeq:{{#titleparts:{{{1|}}}}}|{{#titleparts:{{{2|}}}}}|1|}}</includeonly></onlyinclude>This template compares two strings, returns 1 when they are equal and an empty string otherwise. It is supposed to be used to comapare a string with a pagename, since they got different ways to encode apostrophs. It can be passed in an #if parser function.


== Usage ==
== Usage ==

Latest revision as of 20:50, 9 April 2009

This template compares two strings, returns 1 when they are equal and an empty string otherwise. It is supposed to be used to comapare a string with a pagename, since they got different ways to encode apostrophs. It can be passed in an #if parser function.

Usage

{{compare|STRING1|STRING2}}

Example:

{{#if:{{compare|STRING|{{PAGENAME}}}}|do something if strings equal|else}}