Best Practices for Integrating Modern JS Libraries

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
4/25/2025 4:06:07 AM
Gravatar
Total Posts 2

Best Practices for Integrating Modern JS Libraries

Hello

 

I have been exploring ways to modernize some of my mojoPortal pages by integrating JavaScript libraries like Chart.js and ApexCharts to create dynamic dashboards. smiley The challenge I am facing is figuring out the cleanest way to inject these scripts into specific mojoPortal pages especially while keeping the solution upgrade-friendly and not interfering with the core code or layout system. Has anyone implemented something similar?sad

I’m currently using HTML content modules with script blocks;  but I’ve run into issues with script ordering, loading conflicts & scoped CSS getting overwritten.indecision I’d like to know if there’s a standard or recommended approach within mojoPortal for handling client-side libraries whether via skin-level JS injection, custom modules, or using the script loader system. Bonus if anyone has insight into managing multiple charts or updating them with AJAX calls.smiley Checked https://www.chartjs.org/docs/latest/getting-started/Salesforce Developer Training guide related to this and found it quite informative.

 

If there’s a guide, doc, or example project showing how to cleanly inject and manage third-party JS frameworks in mojoPortal without breaking maintainability, I’d appreciate the pointer.

 

 

 

 

 

 

 

 

Thank you !smiley

4/30/2025 2:05:24 PM
Gravatar
Total Posts 2262

Re: Best Practices for Integrating Modern JS Libraries

Hi Catherine, 

You can add script to pages using the Script module and configure the script to be loaded in the head, at the bottom of the page, or in place.

You can also add script site-wide using the "Custom Content" feature in Site Settings. There is an area for regular pages and admin pages.

Thanks, 
Joe