Pass options to Template Macro

Hi All,

I am trying to add the location picker to a page using the template macro but want to also include the option to showWikis=true

{{template name="locationPicker_macros.vm" /}}

{{velocity}}
  {{html}}
    #locationPicker({...})
  {{/html}}
{{/velocity}}

I have found the template file in /templates directory in linux and created a copy with the options I want in it, and that works. But would prefer to know if there is an easy way to pass the options through. I’ve tried adding it to the #locationPicker JSON but that didn’t work

'options' : {
  'showWikis' : true
}

Any assistance would be greatly appreciated.

See xwiki-platform/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/locationPicker_macros.vm at master · xwiki/xwiki-platform · GitHub . The tree picker shows the wikis only if:

Hope this helps,
Marius

1 Like

Thanks @mflorea.

The second point seems to have worked. I just tested quickly on my phone, but I’ll have a proper look tomorrow.