Ontolica uses XSLT templates for appearance customization of its web parts. Hence, it is possible to change the way search dialogs and results are displayed. Creating and editing XSLT templates is easier when using a specialized XML editor.
Microsoft SharePoint Designer is a good choice for that purpose, because it provides close integration with SharePoint and supports XML formatting and XSLT transformations. It is also distributed as a free download from the Microsoft website. In this article we show an example of how SharePoint Designer can be used to create/edit XSLT templates to freely customize the appearance of the Ontolica Search Center.
We assume that you have already installed and enabled Ontolica functionalities in your MOSS environment. In that case you can proceed with opening the Ontolica Search Center site in SharePoint Designer. Click File / Open Site… and provide the URL of the Ontolica site.


If the site is opened successfully then all the content associated with the site will be listed in the Folder List of SharePoint Designer.

Navigate to OntolicaStyles (Ontolica Styles) folder in the Folder List. This location contains all XSLT templates used by different Ontolica web parts. For example, Search Result folder contains templates that control the appearance of the search results provided by Ontolica.

If you want to modify existing templates or create your own templates, you can use the Copy/Paste feature in SharePoint Designer to create a copy of the existing template. In the first case, the new file can be used as a backup. In the second case, the content of the copied file can be used for inspiration and can be replaced with your own content. In the following example we copy the Default.xsl file and paste it in the same location.


The aforementioned operation creates a copy of the file, which can be renamed according to your needs. You can open the file in SharePoint Designer editor and start exploring the code.

Before you proceed to the next step, make sure that the new file was created in the same folder as the original file. This way the file will be immediately available on the appropriate Ontolica configuration page.
To enable the newly copied/created template go to Site Actions / Edit Page menu of your site.

Then click on Configure this Search Result Web Part to open the configuration page.

The new template should be visible in the list of available search result templates, where you can select it and therefore use the template for displaying search results. Remember to uncheck the Cache compiled XSLT templates checkbox in order to make your code changes done in SharePoint Designer to be instantly applied upon saving the file in SharePoint Designer editor. (Please note that your new template might not have a preview available on the configuration page.)

After clicking the OK button you will be taken back to the Edit Page view where you need to use the Publish button to confirm and publish the performed changes.

Now that the new template has been enabled, you can go back to the SharePoint Designer editor and make required changes in the code of the template.
Every time you will save the template file, the changes should be instantly visible in the Ontolica search results page.


