Conditionally display hits with the Result List widget
- In Mashup Builder, go to the /search page and select the Design view.
- Click the header of the Result List widget.
- On the widget properties panel, go to the Hit templates tab.
-
In the Hit JSP template field:
- Enter the relative or the absolute path to the directory containing your custom JSP.
-
Use a dynamic hit meta in your path to add a condition on the document type.
For example: mytemplate/${entry.metas["type"]}.jsp
-
The dynamic value will apply a specific JSP template for each type of document that has its own dedicated JSP.
The default template is applied otherwise. For example, let’s say that you have created the following JSP templates:
filesystem.jsp
,intranet.jsp
,mail.jsp
, etc.
- Select the Preview to check your configuration changes.
- Click Apply.