Create a dynamic content spot with resource environment providers
We can create a custom dynamic content spot to include in a theme template.
- Log on to the WAS console and go to...
Resources | Resource Environment | Resource environment providers | WP DynamicContentSpotMappings | Custom Properties | New
- Enter a name to be used as the ID of the mapping. For example...
newDynamicContent
- Enter a value that is the URI to the dynamic content to be included by the mapping, similar to the following example:
res:/CustomThemeContext/themes/html/MyTheme/dynamicContent.jsp
- Select OK.
- Save the changes.
- Restart the portal.
- Open the theme template file on WebDAV.
- Locate where in the template to include the dynamic content and add the following line of code:
<link rel="dynamic-content" href="dyn-cs:id:newDynamicContent">
- Clear the browser cache and refresh the page that has the theme template modified to get the new dynamic content spot to render.
Use parameters
We can pass parameters to a JSP page that is rendering the dynamic content. If the page expects a parameter such as text, then we would locate where in the template to include the dynamic content and add the following line of code:
<link rel="dynamic-content" href="dyn-cs:id:<your mappping ID>+'?text=dynatext'">
Parent Create dynamic content spots