Forum Discussion

MariaKyrychenko's avatar
2 years ago

Text placeholder in Khoros studio that can be edited with a script

Hi! I am creating a component, that requires usage of a text that is stored in the reliable place. Cookies, local and session storages are not working for me since this component should work for all Admin users. I need a place in Khoros Studio that can store a short string, be reliable, be accessed via code (Jquery, <Script> Freemarker) and most importantly, that I can edit with the code.

3 Replies

  • Hi MariaKyrychenko 
    You can use Custom Content(Admin > Content > Custom Content) to achieve this. It is reliable and can be accessed/updated using APIs. 

    Here you can get more details about Custom Content: https://community.khoros.com/t5/Custom-Content/About-custom-content/ta-p/108551

    Below discussion can help you find out the API 
    https://community.khoros.com/t5/Khoros-Community-Product/Possible-to-set-up-a-board-moderator-admin-to-update-custom/m-p/485685#M5584

     

  • MariaKyrychenko  You can try using the custom content. You can access the same and update it too. If required, manual updations will also be easy with the custom content. However, you need to be careful that no one updates that accidentally.

  • Also don't forget that you can file a support case and ask for a custom field, in your case probably a node (community (global), category, board) level custom setting which will then be editable in Admin > System > Settings List Editor and can also be updated via API (still using v1 for that as support usually struggles to make them work in API v2).

    As kkritika mentioned, there is (technically with custom settings as well, but less likely) a risk that someone accidentially overrides your custom content, something that may help to avoid that is using the title field of the custom content to clearly state that this should not be touched...