Search result examples

These are examples of how to design your search results.

Search element design example for use in a website

In this example, a table is used to lay out the search results.

Table 1. Search element design example for use in a website
Design field Details Code example
Header
<table>
Result The attributes to display in each search result are defined here.
<tr><td>
    <attributeResource attributeName="namelink"/><br>
    <attributeResource attributeName="summary"/>
</td></tr>
Separator A separator can be used to delineate each search result.
<tr><td  bgcolor="#FFFAA" colspan="2"/></tr>
Footer A page navigation element that is stored in a component is referenced here to add page navigation to the search results.
    <tr><td>
        <component name="pagenavigationcomponent"/>
    </td></tr>
</table>
No results There are no results for your query. Please refine your search and try again.

Search element design example for use in a rendering portlet

In this example, a table is used to lay out the search results.

Table 2. Search element design example for use in a rendering portlet
Design field Details Code example
Header
<table>
Result The attributes to display in each search result are defined here.

When displaying search results in a rendering portlet, you must specify the page that the linked content is displayed in when opened.

A URL map to the portal page that contains the rendering portlet is required.

<tr><td>
<a href="/[PORTAL_CONTEXT_ROOT]/
[PORTAL_PAGE_URL_MAPPING]/?WCM_GLOBAL_CONTEXT=
<AttributeResource attributeName="url" />">
<AttributeResource attributeName="title" /></a>
<attributeResource attributeName="summary"/>
</td></tr>
Separator A separator can be used to delineate each search result.
<tr> <td  bgcolor="#FFFAA" colspan="2"/>  </tr>
Footer A page navigation element that is stored in a component is referenced here to add page navigation to the search results.
    <tr><td>
        [component name="pagenavigationcomponent"]
    </td></tr>
</table>
No results There are no results for your query. Refine your search and try again.