Forum Discussion

mmatthes's avatar
mmatthes
Contributor
14 years ago

Creating custom functionality in Lithium Studio

Assuming that my community is hosted on the Lithium servers and I create a new page via Lithium Studio, can I add Javascript to my new page that accesses the REST API?

 

For example, assume that I want a custom page that allows me to create a single message that is submitted to 5 different threads at the same time.  While this is not useful functionality, it would be easy to do if I have access to the REST API via Javascript.

 

Thanks.

1 Reply

  • AdamN's avatar
    AdamN
    Khoros Alumni (Retired)
    13 years ago

    Hi mmatthes,

     

    You can indeed include Javascript in pages, either through a custom component added to specific pages, or via the wrapper of a skin for inclusion across the community. You can either add your own script tags, or you can use the "liaAddScript" directive in FreeMarker, which will insert your JavaScript near the bottom of the page.

     

    Here's an example of using JavaScript in a custom component:

    http://lithosphere.lithium.com/t5/Developers/Ajax-search-Before-Post-Freemarker/m-p/23874/highlight/true#M117

     

    I hope this helps!

     

    -Adam