Using the Widget API

Description

Since dotCMS 2.1 we provide an API to render a Widget based on its identifier.

This example shows how to use the api to pull a Widget from another dotCMS installation and render it on your site. 

It pulls the Local Weather from the Demo site and displays it like this:


$myStr

Code

#set($myStr =$import.read("http://demo.dotcms.com/api/widget/id/f2966056-b28b-4b90-8d39-bc4af09c13b3"))
$myStr