Hi,

I would like to conditional show pages based on request parameter
But i'm struggling with the fact if there is not a request parameter

{{velocity}}
#if("$request.cntryCode" != "es")
 {{include document="Sandbox.TryCr"/}}
#else
  {{include document="Sandbox.TryEs"/}}
#end
{{/velocity}}

So if the request parameter cntryCode is not "es" (so anything else) show first 
page TryCr otherwise show page TryEs
But what if no parameter is givven; then I would like to show TryEs (assume 
parameter was "es"

Any suggestions

second question; how can i best use the parameter to avoid extensive coding;
Instead of
#if("$request.cntryCode" != "cr")
 {{include document="Sandbox.Trycr"/}}
#elseif("$request.cntryCode" != "hn")
 {{include document="Sandbox.Tryhn"/}}
#elseif("$request.cntryCode" != "el")
 {{include document="Sandbox.Tryel"/}}
#elseif("$request.cntryCode" != "ng")
 {{include document="Sandbox.Tryng"/}}
#else
  {{include document="Sandbox.TryEs"/}}
#end

I would only think i need to concatenate the parameter to the end of the 
documentname Tryxx to get the good document

Hope somebody can help me

Gerritjan

_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to