Thomas and Vincent, thank you both for the feedback. If parameters supported
data type it would open up a lot of nice options for wiki macros but I can
manage without. It's easy enough to fake the Boolean type and the macro I
wanted to use arrays is just for building the site pages and not for p
> On 03 Apr 2016, at 02:02, Personal wrote:
>
> Is it possible to pass an array as a macro parameter? So far my attempts have
> failed.
no, it’s not really possible to pass typed parameters to macros in wiki syntax.
However, if the macro is written in Java and it expects a List, and you
pass
On Sun, Apr 3, 2016 at 11:20 AM, Thomas Mortagne
wrote:
> What you need to keep in mind is that {{test}} is wiki syntax, it's
> not a Velocity/Java API. You print it with Velocity, you don't call
> it. So this is all text until the wiki parser parses it, to pass an
> array you need to serialize it
What you need to keep in mind is that {{test}} is wiki syntax, it's
not a Velocity/Java API. You print it with Velocity, you don't call
it. So this is all text until the wiki parser parses it, to pass an
array you need to serialize it with the right syntax.
A good way to understand and debug that
For that matter are any other data types, like Boolean for example, allowed as
macro parameters?
Regards,
Jesse
> On Apr 2, 2016, at 5:02 PM, Personal wrote:
>
> Is it possible to pass an array as a macro parameter? So far my attempts have
> failed.
>
> Macro code:
> #set( $a = $xcontext.ma
Is it possible to pass an array as a macro parameter? So far my attempts have
failed.
Macro code:
#set( $a = $xcontext.macro.params.array)
$a
#foreach($i in $a)
$i
#end
Page code:
#set( $array = ['Chapter 1', 'Chapter 2', 'Chapter 3'])
$array
#foreach($i in $array)
$i
#end
{{test array=$