Embedding Custom Code in cmsTCpro (Instruction)
The cmsTCpro system provides developers with two levels of custom code integration: from simple injections to complex dynamic modules. This allows you to connect any payment gateways, analytics systems, and interactive widgets without modifying the CMS core.
Method 1: Global Injections (Config Panel)
The fastest way to connect external services (Google Analytics, Yandex Metrica, JivoSite, etc.).
- Go to Administration -> Config.
- Use the Basket field to insert HTML markup (e.g., buttons or containers).
- Use the Script3 field to insert pure JavaScript code.
Note: Code from these fields is automatically loaded onto active pages and executed in the user's browser context.
Method 2: Dynamic JS Modules (Active Pages)
To create complex interfaces (e.g., a custom cart or user dashboard), use isolated modules.
- Create a file named
my_module.jsin thewwwroot/js-modules/directory on your server. - Define the module logic using function export:
export function initModule(element, data) { element.innerHTML = "<h3>Module active for: " + data.userName + "</h3>"; // Your logic goes here (Stripe, PayPal, API) } - The module will automatically be available at:
/module-view/{Area}/my_module.
Security and Access
All active pages in cmsTCpro are protected by the [Authorize] attribute by default. This ensures that your custom code (e.g., a payment form) is only visible to authorized clients, and user data (userName, email) is securely passed to your script from the system.
For additional code examples or consultations regarding the cmsTCpro API, please contact technical support at tutocito.com.

