Go to the first, previous, next, last section, table of contents.
Now that the browsing interface for urlcatalog is customized, we still have to customize the search result display so that the records are displayed in the same way. The default template used to display the search results is csearch.html and contains:
<title>Search results for _TEXT_</title> <center> <form action=_SCRIPT_ method=POST> _HIDDEN_ <input type=text size=40 name=text value='_TEXT-QUOTED_'> <input type=submit value='search'><br> _WHAT-MENU_ </form> </center> <!-- start categories --> <center>Categories matching <b>_TEXT_</b> (_COUNT_)</center> <ul> <!-- start entry --> <li> <a href=_URL_>_PATHNAME_</a> <!-- end entry --> </ul> <!-- start pager --> Number of pages _MAXPAGES_ <p> _PAGES_ <!-- end pager --> <!-- end categories --> <!-- start nocategories --> <center>No category matches the search criterion</center> <!-- end nocategories --> <!-- start records --> <center>Records matching <b>_TEXT_</b> (_COUNT_)</center> <table border=1> <!-- start entry --> <!-- start category --> <tr><td colspan=20><a href=_URL_>_PATHNAME_</a></td></tr> <!-- end category --> <tr>_DEFAULTROW_</tr> <!-- end entry --> </table> <!-- start pager --> Number of pages _MAXPAGES_ <p> _PAGES_ <!-- end pager --> <!-- end records --> <!-- start norecords --> <center>No record matches the search criterion</center> <!-- end norecords -->
This template is hairy because it contains many alternatives that define the HTML code to display:
Assuming that we search for records in the example database, the default display looks like this:
To customize the records display we only have to change the records part to duplicate what was done in the cbrowse.html template. You will notice that the entry part have a sub part named category:
<!-- start records --> <center>Records matching <b>_TEXT_</b> (_COUNT_)</center> <dl> <!-- start entry --> Sub part of entry that only shows once for a given category <!-- start category --> <p> <dt><b>Category</b> <a href=_URL_>_PATHNAME_</a> <!-- end category --> <p> <dt><a href='_URL-QUOTED_'>_COMMENT_</a> <dd> <a href='_URL-QUOTED_'>_URL_</a> <dd> <i><font size=-1>Created _CREATED_</font></i><br> <!-- end entry --> </dl> <!-- start pager --> Number of pages _MAXPAGES_ <p> _PAGES_ <!-- end pager --> <!-- end records -->
This subpart must always be in the entry part. It will be displayed to show the category of the displayed record each time the category changes. Since the search results are sorted to group the records in the same category together, this will prevent showing the category name multiple times.
To continue with the renaming scheme used in the previous section we re-map csearch.html into urlcatalog_csearch.html in the templates.conf file.
# # Templates system configuration # style # # Catalog customization # urlcatalog # # Search results # csearch.html = urlcatalog_csearch.html # # Root of Catalog browsing # cbrowse_root.html = urlcatalog_cbrowse_root.html # # Pages of Catalog browsing # cbrowse.html = urlcatalog_cbrowse.html end end
The search results when searching for www is now:
At this point we have covered all the operations needed to customize the user view of the urlcatalog thematic catalog as shown when clicking on the Browse URL catalog (urlcatalog) link in the example HTML entry point. By defining a new style you could create a new display. All we needed to implement this customization are four files : templates.conf, urlcatalog_csearch.html, urlcatalog_cbrowse_root.html and urlcatalog_cbrowse.html.
Go to the first, previous, next, last section, table of contents.