Hello there,
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" end
"{{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.