User:Celierra Darling/Sandbox

From Second Life Wiki
< User:Celierra Darling
Revision as of 04:05, 2 January 2009 by Celierra Darling (talk | contribs) (Start sandbox, →‎Specific Instruction Template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Specific Instruction Template

I think Template:Specific Instruction would be something like:

{{#ifeq: {{{current|{{{1|}}}}}} | * | {{{3|{{{2|}}}}}} |
 {{#if: {{{target|{{{3|}}}}}} |
  {{#ifeq: {{{current|{{{1|}}}}}} | {{{target|{{{2|}}}}}} | {{{3|}}} | }} |
  {{#if: {{{current|{{{1|}}}}}} | {{{2|}}} | }}
 }} }} 

...but I haven't tested this thoroughly.

I imagine the template would be used in one of these ways:

{{Specific Instruction | {{{A|<noinclude>*</noinclude>}}} | text}}

...which outputs the text if A is defined and non-blank or if the current page is being viewed on its own (e.g. if you're looking at CMake, not some article that calls {{:CMake}}). It outputs nothing otherwise.

{{Specific Instruction | {{{A|*}}} | B | text}}

...which outputs text iff A is the string "B", A is the string "*", or the current page is being viewed on its own. This defaults to showing the message if A is undefined.

{{Specific Instruction | {{{A|<noinclude>*</noinclude>}}} | B | text}}

...the same as above, but defaults to not showing the message if A is undefined.

Also, there will probably need to be a different template designed to test versions (i.e. whether 1.22 < 1.20), using #ifexpr statements.

P.S. I think the noinclude tags are an obfuscatory hack. Does anyone know of a better way to do it?