Reference and Advanced Topics / Designing Place Overview Pages |
The HTML and Formatted Text widgets are extremely flexible, but should be used carefully to ensure effective, performant pages.
The HTML and Formatted Text widgets are designed to display customized information on Overview places, including the community Home page. You can use them to embed all kinds of assets, including images. These widgets are often used to provide visual orientation or branding to the site or the place. The HTML widget also allows you to add JavaScript and CSS elements, with certain security limitations, which are described later in this topic.
To ensure security and prevent problems that can corrupt your pages and keep them from loading, any HTML widget code that calls a <script> tag will be contained in an isolated iFrame. This is known as "safe mode." If you want to include CSS or other styling in the widget, you can include it in the same location as your HTML code. Isolation of the HTML widget also means that the widget can't borrow JavaScript from the Overview page, and that visual components cannot extend beyond the perimeter of the iframe. Simple HTML, JavaScript, and CSS continue to be supported.
In safe mode, you can still call the assets associated with the core Jive installation as follows: <script src="/resources/scripts/jquery/jquery.js"></script> <link rel="stylesheet" href="/styles/jive.css" media="all">
It's possible for your site administrator to use a system property to override the default "safe mode" behavior (iFrame isolation) and allow external JavaScript access from the HTML widget. However, this approach requires caution and is not recommended. In previous versions, before the safe mode was implemented for widgets, it was possible for corrupted widget code to cause serious problems that affected the database.
Widget upload access should be limited to users you trust. Because any social group owner can upload resources to these widgets, it's possible for users to make incorrect judgments about appropriateness and security, so make sure group owners are carefully chosen.