Test /
PagelistParameterVariables
Test the usage of PageLists variables? as parameters
Specifying variables as parameters
You can also specify variable values inline with the pagelist statement, and refer to the variables in the template using the {$$variable1}
format:
(:pagelist fmt=#pagelist variable1="value" variable2="value2":)
This assumes that a site has $EnableRelativePageVars
enabled, which is recommended in PmWiki 2.2.0 -- but disabled by default to help people upgrading from 2.1.x.
>>comment<< [[#tvars]] (:template default count=1:) Hi, {$$Name}, how are you today? [[#tvarsend]] >><< (:pagelist fmt=#tvars Name=Sam:) (:pagelist fmt=#tvars Name="Sally S":) | Hi, Sam, how are you today? Hi, Sally S, how are you today? |
>>comment<< [[#tvars2]] (:template default count=1:) Hi, {$$Name1}, how are you today? -> I'm fine thanks {$$Name2} [[#tvars2end]] >><< (:pagelist fmt=#tvars2 Name1=Sam Name2="Pam P":) (:pagelist fmt=#tvars2 Name1=Sally Name2="Harry H":) | Hi, Sam, how are you today? I'm fine thanks Pam P
Hi, Sally, how are you today? I'm fine thanks Harry H
|
>>comment<< [[#tvars3]] (:template default count=1 Name='anonymous':) Hi, {$$Name}, how are you today? [[#tvar3send]] >><< (:pagelist fmt=#tvars3 :) (:pagelist fmt=#tvars3 Name=Sally:) | Hi, anonymous, how are you today? Hi, Sally, how are you today? |