[Mediawiki-l] Parserfunction "ifeq" not recognizing Magic Words?

Birger bweynants at gmail.com
Fri Jul 28 12:24:08 UTC 2006


I am trying to show different images, dependent on some conditions:

Scenario 1: if the pagename is the same as a given pagename,
image_1.gif is shown.
Scenario 2: if the pagename is not the same as the given pagename, the
existence of the given pagename is checked:
         Scenario 2a: if the given pagename exists, image_2a.gif is shown.
         Scenario 2b: if the given pagename does not exist,
image_2b.gif is shown.


So i wrote:
 {{if:
       {{ifeq:
{{NAMESPACE}}:{{PAGENAME}} | {{NAMESPACE}}:{{BASEPAGENAME}}/subpage | true
       }}
  | [[Image = image_1.gif]]
  | {{ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}/subpage
                | [[Image = image_2a.gif]]
                | [[Image = image_2b.gif]]
      }}
 }}

The problem is that image_1.gif does not appear, even if
{{NAMESPACE}}:{{PAGENAME}} has the same value as
{{NAMESPACE}}:{{BASEPAGENAME}}/subpage (e.g. image_2a.gif appears then
instead because the page exists). Does the parserfunction "ifeq"
compares the values litterally without interpreting the magicwords? I
don't think there is any mistake in the above wiki-code because when i
substitute "{{NAMESPACE}}:{{PAGENAME}}" by "a" and
"{{NAMESPACE}}:{{BASEPAGENAME}}/subpage" by "a", so that the
comparison is "a=a" (which is true) the image_1.gif is correctly
displayed.

Does anyone know whether the magicwords in the parserfunction "ifeq"
are recognized and what the cause of the problem is? If this
parserfunction does not interpret magic words, is there another
solution to display image_1.gif in case the pagename is the same as a
given pagename?

Thanks in advance!

B.



More information about the MediaWiki-l mailing list