[pmwiki-users] Passing blocks of markup to an include
Petko Yotov
5ko at 5ko.fr
Tue Jun 22 01:54:33 PDT 2021
We have built-in PageTextVariables, see documentation:
https://www.pmwiki.org/wiki/PmWiki/PageTextVariables
In your page:
(:include Template.MyTemplate param1="{*$:Var1}" :)
(:Var1:my markup block:)
The above will work exactly as if you wrote:
(:include Template.MyTemplate param1="my markup block" :)
Note that the include markup doesn't expect line breaks in the
parameters, so your variable you can be a line, not a multiline block.
If I need to pass a multiline block, I would try passing a page section
to be included by the included page, something like:
(:include Template.MyTemplate param1="SomePage#start#end" :)
and then Template.MyTemplate has a line like this:
(:include {$$param1}:)
And SomePage contains something like:
[[#start]]
This is line 1.
Line 2.
[[#end]]
Petko
On 21/06/2021 22:04, Charlie Hayes wrote:
> I would like to pass a block of markup to an (:include :)
>
> Something like:
>
> (:set var1:)
> my markup block
> (:setend:)
> (:include Template.MyTemplate param1={$var1} :)
>
> I’ve been playing around with and reading through the documentation
> and can’t figure out a built in method or a cookbook plugin.
>
> Any ideas?
>
> -Charlie
More information about the pmwiki-users
mailing list