Forum Discussion
Hi Scott,
Sorry for the late follow up. I was forwarded to your post by someone else that had the same question. I figured I'd reply here for the benefit of others.
If you’re adding the component to a page via the page editor in Studio, then I believe you’re fairly restricted in what types of values you can use… pretty much just strings as you discovered.
If you’re adding the component to another component via the <@component> macro, then you have a bit more flexibility. With the macro, you can pass other types and objects as well. For example:
<#assign community=rest("/").community /> <@component id="paramtest" param=community />
Then in your paramtest component, you could do something like:
${env.context.component.getParameter('param').id}
to give you the id of the community.
Here's a better example more a long the lines of what you were talking about. This example shows passing some threads:
<#assign threads=rest("/threads/recent").threads /> <@component id="paramtest" param=threads />
Then in your paramtest component:
<#assign threads=env.context.component.getParameter('param') /> <#list threads.thread as thread> ${thread.messages.topic.subject}<br/> </#list>