Forum Discussion
Can you share some more architecture details on which module is calling which? I'm not sure I understand "client" and "server" terminology in the context of your scenario.
Do you want to populate that component during page load or will the information from your external data warehouse be dynamically called from JS on the page after it has loaded? This will determine the approach and technology to use.
You can pass parameters to a custom component and you can use this for modals as well: https://community.lithium.com/t5/Developer-Knowledge-Base/Passing-Parameters-to-a-Custom-Component/ta-p/88704
Also a somewhat related discussion on how to pass information from a custom component to an endpoint is discussed here: https://community.lithium.com/t5/Developer-Discussion/Passing-parameter-from-custom-component-to-an-endpoint/m-p/134595#M5208
Hello ClaudiusH -
Thanks for jumping in to help. I'll do my best to explain - my Lithium-specific terminology is admittedly not the best.
We have a component which currently uses Lithium-assigned roles in an if/then/else statement to display other components.
A basic view is the following:
<#if user_is_in_role > <@component id="Component1a" /> <#else> <@component id="Component1b" /> </#if>
This has been working well, except that we're using the Lithium role definitions to assign a value to the 'user_is_in_role' variable. We're now working to replace the role-based variable assignment with an external data source making RESTful API calls with http.client. This is where we run into challenges.
We can successfully make the requests and compile the JSON results in an endpoint. However, where we're getting stuck is assigning the variables so that they can be referenced within if/then/else statements in the primary component. It sounds very similar to the second post you shared, but in reverse order where assigning the variable in the endpoint is returning a null response from the component.
- bpliskow8 years agoAdept
Anyone with thoughts/advice?
- ClaudiusH7 years agoKhoros Alumni (Retired)Ideally you would leave the role based branching intact and instead have the REST API call to your data source set the role instead.
How often do these roles change? How quick do they need to update? You would want to avoid checking via a REST call against your source every time this page is loading. Maybe it's sufficient to perform this check every time a user signs in to your community?
Related Content
- 4 years agoInactive User
- 6 months ago