AquaLogic User Interaction Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Creating a Search Results Adaptive Page Layout

The Search Results adaptive page layout defines the search results content area. The outer area (header, footer, navigation areas) is based on the Base Page adaptive layout.

The pt:searchpage library includes a set of tags to customize search results display. The searchresultsdata tag provides all the data needed to display search results. Each result is a DataObject that includes the following variables:
Variable Description
name The name of the result.
description The description of the result.
rank The rank of the result.
resulthref A gatewayed link to the result.
resultonclick An onclick handler for result link if a handler exists.
resulttarget The target window name for result link if a target exists.
icon The URL to the icon for the result.
iconalttext Alternate text for the icon associated with the result.
iconwidth The width of the icon associated with the result, in pixels.
lastmodified A string in the current locale representing the last modified date.
propertieshref A link to the properties for the result if a properties link exists.
propertiesonclick An onclick handler for result link if a properties link exists.
isbestbet True if the result is a best bet, false otherwise.
isinmultiplefolders True if the result occurs in more than one Knowledge Directory folder.
folderpathhref A link to the Knowledge Directory folder for the result if one exists.
folderpath The path to the Knowledge Directory folder for the result if one exists.
projectname The name of the Collaboration project containing the result if the result is a Collaboration item.
projectonclick An onclick handler for the link to the Collaboration project containing the result if the result is a Collaboration item.
lastpublishedby The name of the last publishing user if the result is a Publisher item.
associatedobjectsonclick An onclick handler for the link to the associated objects for the result if the result is a Publisher item.
The paginationdata tag provides variables to handle pagination. The followupformdata tag generates the data required to create the follow-up search form shown on the results page. Additional tags define specific form elements.
The example below uses tags from the pt:searchpage library to define Search Results components, and logic tags to iterate over results.
Note: This example has been oversimplified for illustration purposes; for a complete implementation of the search results page layout, see the searchresultslayout.html file in the \imageserver\plumtree\portal\private\pagelayouts folder on your ALI image server.
<div id="content" xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'>
	<pt:core.comment>
		<!-- Layout for the search results page.  This layout file renders the portal search results page.
			 It shows a followup search form and results.
		 -->
	</pt:core.comment>
    <pt:searchpage.searchresultsdata pt:id="groupedresults"/>
	<pt:searchpage.searchsummarydata pt:id="summary"
									 pt:groups="groups"
									 pt:spellcorrections="spellcorrections"
									 pt:breadcrumbs="breadcrumbs"
									 pt:properties="properties"
									 pt:collabprojects="collabprojects"
									 pt:portlets="portlets"
									 pt:folders="folders"
									 pt:communities="communities"
									 pt:objecttypes="objecttypes"/>

... search modification and sorting implementation ... 

	<div id="ali-search-results">
	    <pt:logic.collectionlength pt:data="groupedresults" pt:key="resultslength"/>
	    <pt:logic.intexpr pt:expr="($resultslength) > 0" pt:key="hasResults"/>
	    <pt:logic.if pt:expr="$hasResults">
        <pt:logic.iftrue>
            <table id="ali-search-results-table">
            <pt:logic.foreach pt:data="groupedresults" pt:var="resultsgroup">
                <pt:logic.variable pt:key="results" pt:value="$resultsgroup.groupresultskey"/>
                <pt:logic.collectionlength pt:data="$results" pt:key="resultslength"/>
                <pt:logic.intexpr pt:expr="($resultslength) > 0" pt:key="hasResults"/>
                <pt:logic.if pt:expr="$hasResults">
                    <pt:logic.iftrue>
                        <pt:logic.foreach pt:data="$results" pt:var="result">
                            <pt:logic.variable pt:key="htmlEncodedName" pt:value="$result.name" pt:encode="1" />
                            <tr>
                                <td><pt:core.html pt:tag="img" src="$result.icon" alt="$htmlEncodedName"/></td>
                                <td>
                                    <p class="ali-kd-docs-title">
                                        <pt:logic.existexpr pt:data="result.resultonclick" pt:key="hasResultOnclick"/>
		                                <pt:logic.if pt:expr="$hasResultOnclick">
		                                  <pt:logic.iftrue>
	                                        <pt:core.html pt:tag="a" href="$result.resulthref" onclick="$result.resultonclick" title="$htmlEncodedName"><pt:logic.value pt:value="$result.name"/></pt:core.html>
		                                  </pt:logic.iftrue>
		                                  <pt:logic.iffalse>
			                                <pt:logic.existexpr pt:data="result.resulttarget" pt:key="hasResultTarget"/>
			                                <pt:logic.if pt:expr="$hasResultTarget">
			                                  <pt:logic.iftrue>
				                                <pt:core.html pt:tag="a" href="$result.resulthref" target="$result.resulttarget" title="$htmlEncodedName"><pt:logic.value pt:value="$result.name"/></pt:core.html>
			                                  </pt:logic.iftrue>
			                                  <pt:logic.iffalse>
				                                <pt:core.html pt:tag="a" href="$result.resulthref" title="$htmlEncodedName"><pt:logic.value pt:value="$result.name"/></pt:core.html>
			                                  </pt:logic.iffalse>
			                                </pt:logic.if>
		                                  </pt:logic.iffalse>
		                                </pt:logic.if>
                                    </p>
                                    <p>
                                        <pt:logic.existexpr pt:data="result.description" pt:key="hasDesc"/>
		                                <pt:logic.if pt:expr="$hasDesc">
			                                <pt:logic.iftrue>
		                                    <pt:core.comment><!-- The description contains HTML from search, and is safe, so we shouldn't HTML encode it. --></pt:core.comment>
		                                    <pt:logic.value pt:value="$result.description" pt:encode="0"/>&nbsp;
			                                </pt:logic.iftrue>
			                                <pt:logic.iffalse>
		                                    <i><pt:logic.value pt:value="$#832.ptmsgs_portalbrowsingmsgs"/></i>
			                                </pt:logic.iffalse>
		                                </pt:logic.if>
                                    </p>
                                    <p class="ali-search-results-modified">
                                        <pt:core.localize pt:id="1918" pt:file="ptmsgs_portalbrowsingmsgs" pt:replace0="$result.lastmodified" />
	                                    <pt:logic.existexpr pt:data="result.propertieshref" pt:key="hasPropsLink"/>
		                                <pt:logic.if pt:expr="$hasPropsLink">
			                                <pt:logic.iftrue>
					                            <pt:core.html pt:tag="a" href="$result.propertieshref" onclick="$result.propertiesonclick" title="$#1657.ptmsgs_portalbrowsingmsgs"><pt:logic.value pt:value="$#31.ptmsgs_portalbrowsingmsgs"/></pt:core.html>
			                                </pt:logic.iftrue>
		                                </pt:logic.if>
                                    </p>
                                </td>
                            </tr>
                        </pt:logic.foreach>
                    </pt:logic.iftrue>
                </pt:logic.if>
            </pt:logic.foreach>
            </table>
        
... page navigation implementation ...

        <pt:logic.iffalse>
            <table id="ali-search-results-table">
                <tr><td>
                    <p><pt:logic.value pt:value="$#848.ptmsgs_portalbrowsingmsgs"/></p>
                </td></tr>
            </table>
            <br />
        </pt:logic.iffalse>
	    </pt:logic.if>
    </div>
</div>
</div>
For details on configuring adaptive page layouts in the portal, see the AquaLogic Interaction Administrator Guide.

  Back to Top      Previous Next