+

Search Tips   |   Advanced Search

Control contributing markup using a dynamic content spot


We can control contributing markup using a dynamic content spot

We can display a dynamic content spot only when a particular module is turned on. This is possible with the following format: <a rel="dynamic-content" href="http://setgetweb.com/p/portal80/res:path/to/some/dynamic/content/spot.jsp, some_module_name"></a>/ This means that the spot.jsp file is only processed when some_module_name is turned on.
Dynamic content spots and markup contributions are both techniques for adding HTML to a theme, with one important difference. Markup contributions are always placed at the end of the body of the page, while dynamic content spots render wherever they are placed in the theme HTML template.

When a module requires markup, use a markup contribution if it is not important where the module is in the page, such as with iWidget definitions. If the markup must appear in a particular spot in the theme, then a conditional dynamic spot is used.

In the portal 8.0 theme, there is a button in the banner to enter page Edit mode, or return to View mode.

In the theme HTML template, the button is rendered with this dynamic content spot:

<a rel="dynamic-content" href="http://setgetweb.com/p/portal80/dyn-cs:id:80theme_pageModeToggle"></a>/
which maps to this URI through the WP_DynamicContentSpotMappings Resource Environment Provider in WebSphere Application Server: res:/wps/defaultTheme80/themes/html/dynamicSpots/pageModeToggle.jsp, wp_toolbar

The wp_toolbar module contains the JavaScript resources necessary for page editing, so you only want the button to render when this module is on.


Parent: Dynamic content spots