Forum Discussion
Custom components produce HTML and are designed to be embedded within Lithium pages.
ActiveCast widgets work by injecting JavaScript (hosted on Lithium) into an external page, which in turn injects HTML into the host page.
If you want to create your own ActiveCast widget, the best approach is to create a custom endpoint that outputs JavaScript, then use a <script> tag to inject this into your external page.
Another approach is to create a custom endpoint that returns JSON, and write some JavaScript that calls the endpoint, and consumes the JSON.
Indeed, as nathan described in detail, if you have a requirement to reuse components on the Lithium community and on other websites (for example, a support portal landing page that showcases community content), then the recommended approach is to leverage the Studio Endpoints. I would personally use a JSON endpoint that can be then called from either a Lithium standard component, or externally. The data can be packaged up in the format that is most suitable for handling in the client.
It is also possible to call the REST API directly (especially if using Lithium SSO), however if you need multiple calls then the endpoint saves you from making multiple HTTP calls and it is definitely better performance-wise.
Thanks,
- micha8011 years agoExpert
Hi nathan,
hi PaoloT,
I havn't worked with endpoints so far but it sounds like i have to try this out. I will give you feedback on how this is going to work or if I stuck in the middle ;) ...
Thanks a lot,
Michael
- nathan11 years agoExecutive
Good luck.
A good place to start is here:
http://community.lithium.com/t5/Components-endpoints-and-the/About-endpoints/ta-p/108971
Related Content
- 16 years ago
- 12 months ago
- 4 years ago