Calling Remote Widgets

Last Updated: Jun 8, 2021
documentation for the dotCMS Content Management System

Dotcms supports calling widgets between different servers using the RESTful widget api. For example, if Site A needs to display a widget that exists on Site B, then the webmaster administering Site A can use the widget api to call the “remote widget” on Site B and dynamically display Site B content. There are two methods that can be used to accomplish this.

The Import Tool

Use the import tool to call the widget using the RESTful API, similar to the following:


Load the remote widget via a Javascript Function

Javascript cost similar to the following may be used to call the remote widget:

<div id="testLoadDiv" >


Important: Javascript Security

When calling the remote widget via a Javascript function, the following must be added to the REMOTE WIDGET page before the remote widget code. This satisfies browser security and allows the injection of the remote code.

$response.addHeader("Access-Control-Allow-Origin", "")

On this page


We Dig Feedback

Selected excerpt: