IncludeWithVariable
Test Include other pages with variable
Test the consistency of PmWiki variables when undefined, or defined with null and empty values. Also test the case sensitivity of variable names
[[#ivars]]
Hi, {$$Name}, how are you today?
[[#ivarsend]]
|
Then, including that section above (that section is available via the section ) you get this type of behavior:
{$FullName}#ivars
(:include {$FullName}#ivars Name=Sam:)
| Hi, Sam, how are you today? |
(:include {$FullName}#ivars:)
| Hi, , how are you today? |
(:include {$FullName}#ivars Name=:)
| Hi, , how are you today? |
(:include {$FullName}#ivars Name='':)
| Hi, , how are you today? |
(:include {$FullName}#ivars name=cam:)
| Hi, , how are you today? |
Try something similar with page text variables
Avariable: v1 Bvariable: |
Avariable: v1 Bvariable: |
Avariable="{$:Avariable}"
Bvariable="{$:Bvariable}"
Cvariable="{$:Cvariable}"
|
Avariable="v1" Bvariable="" Cvariable="" |
avariable="{$:avariable}"
bvariable="{$:bvariable}"
cvariable="{$:cvariable}"
|
avariable="" bvariable="" cvariable="" |
Variables in page lists
>>comment<<
[[#pvars]]
(:template default count=1:)
Hi, {$$ParamName}, how are you today?
[[#pvarsend]]
>><<
|
This gives:
(:pagelist fmt=#pvars ParamName="Pam":) | Hi, Pam, how are you today? |
(:pagelist fmt=#pvars ParamName=:) | Hi, , how are you today? |
(:pagelist fmt=#pvars:) | Hi, , how are you today? |
(:pagelist fmt=#pvars paramname="cam":) | Hi, , how are you today? |
Try with Page Directives.
{$Titlespaced}
{$Description}
{$NoSuchVariable}
|
Include With Variable |
{$titlespaced}
{$description}
{$nosuchvariable}
|
Escaped template variables?
Conditional expression
[[#tplcond]]
(:if equal "{$$Who}" "Petko":)
%Py%''Petko'' Yotov
(:elseif equal "{$$Who}" "Pm":)
%Pm% '''P'''atrick '''M'''ichaud
(:else:)
%red% No wikistyle defined for '''{$$Who}'''.
(:if:)
[[#tplcondend]]
|
(:include {$FullName}#tplcond Who=Pm:)
----
(:include {$FullName}#tplcond Who=Simon:)
----
(:include {$FullName}#tplcond:)
----
(:include {$FullName}#tplcond Who=Petko:)
|
Patrick Michaud No wikistyle defined for Simon. No wikistyle defined for . Petko Yotov |