Function detail pages are a detail page mechanism for dynamic functions. Here we describe how to create and configure a detail page for a dynamic function.
Collect data in a form, which can appear on several pages of the website. Display the results of the user request on one page in the navigation. For example, integration of a search form on several pages of the website and displaying of the search results on one page in the navigation. Since OpenCms 8.0.3 you can use function detail page to define such result pages.
Following steps are required to create dynamic function and its function detail page:
As only users with the role TEMPLATE_DEVELOPER
can edit the dynamic function elements, the function should be created inside the module folder: /system/modules/[module name]/functions/
. To hide the function element from "Add content" Dialog set following property:
The drag & drop option is enabled for user with the role WORKPLACE_USERS
.
${cms.functionDetail['Name of the function detail page']}
for the attribute action
of the <form>
tag.<%@page buffer="none" session="false" taglibs="c,fn,cms" %>
<div class="box box_schema1">
<form action="${cms.functionDetail['simplecalculator']}" method="post">
<%-- ... --%>
</form>
</div>
/system/modules/[module name]/functions/
of the module. One of the dynamic functions should point to the form JSP and another to the detail page JSP./system/modules/[module name]/.config
and configure the function detail page in the tab "Functions". Add new field "Named function". Define a unique name for the function detail. This should be the same name, which is used in the form JSP as action parameter. After this configuration the function detail page appears in the tab "Function pages" of the "Create page" dialog in the sitemap editor.container.info
on the template JSP. Set the property value functionDetail=[container name attribute]
. As value, use the name
attribute of the container, in which the function results should be displayed.