WHMCS Base URL Template Variable

The WHMCS System URL setting records the path to the WHMCS directory on your server. You can set this in the General tab at Configuration () > System Settings > General Settings.

System theme template files require the WHMCS System URL setting for JavaScript AJAX calls to function correctly and for WHMCS to find and access required resources. They retrieve this setting through the whmcsBaseUrl template variable.

Warning

If your active system theme template does not define this variable, you will see the following warning in the browser console:

Warning: The WHMCS Base URL definition is missing from your active template.

To resolve this warning, you must add the following code to the <head> section of your template:

<script>
var whmcsBaseUrl = "{\WHMCS\Utility\Environment\WebHelper::getBaseUrl()}";
</script>

Make certain that you define this variable before the scripts.min.js file.

By default, the Six template defines this parameter within the /includes/head.tpl system theme template file.

Last modified: May 29, 2024