Tutorial: Configuring the availability search (4 / 4)

Tutorial Table of Contents

part 1: Advanced integration set-up
part 2: Simple integration set-up
part 3: Different search modes
part 4: Changing the way the search results look and the information is displayed
Part 4 of 4: Changing the way the search results look and the information is displayed
You can change every aspect of the search page, both the presentation and the content. As with other content types in planyo, you do this by changing the default templates. Templates are basically snippets of HTML code although you usually don’t need knowledge of HTML in order to edit them. Planyo lets you use a WYSIWYG editor so you don't have to edit source HTML code, plus in case of repeating/compound templates (as the inner template explained next) you can choose the table view, which lets you specify the number of table columns and then contents of each column. In compound templates you have an outer template and inner template. In this case the outer template (global result code) is displayed once and in place of a tag: $(results) the contents of the inner template (resource result code) are inserted once for every result. The template can also contain a number of other tags, for example the inner template can use tags representing resources and the particular result, such as $(price) representing the price for given result and dates searched, or $(desc) which is replaced by the description of the resource. The full list of tags you can use can be found under each template box.

Once your template is defined, you can also customize the look&feel of the content by using your own stylesheet, please see Q166 in the FAQ.

Other than the compound inner and outer template (global result code and resource result code) you have two other templates which you can customize: Search view template is the base template which normally includes just two items: the search box and the search results. You can use it if you wish to add other items outside of or between these areas.

The ’No matching results’ code is used when the search gives zero results. In this case you can use this template to display a basic ‘no results found’ message (this is the default) but you can also do other things, such as display the calendar preview such as the upcoming availability preview (simply include the $(site_upcoming_preview) tag) or you can even retry the search with less restrictive criteria or different search mode or dates. Below are a few sample templates which you can use:

No matching results code templateDescription
$(S_NORESFND2)<br/><br/>
$(site_av_preview)
This displays the message “Sorry, no results matching your search criteria were found”. You could of course write these words into the template directly but this wouldn’t be translated into other languages in case the customer chooses another language. Then the template displays the availability preview so the customer can quickly check the other dates when resources can be available
No results matching your search criteria were found. Below are our suggestions for similar dates.<br/><br/>
$(search.type=periods_day_range_ext7)
$(retry_search)
This template first informs the customer that no results were found according to their criteria (if you wish to have such custom message appear in different languages you’ll need to use conditional tags in connection with the $(language) tag (more about this here). Then the template changes the search criteria in two ways using the $(search.type=...) tag. First it changes the search mode into a mode where the search also finds shorter available periods within the search period and it also extends the searched period by 7 days (before the start date and after the end date). For example if the customer searches for availability between Feb 10 and Feb 15, this will retry the search between Feb 3 and Feb 22 but will also find availability, say between Feb 13 and Feb 16. In fact this retried search will list all available periods, not just one (as long as $(available_time_ranges) is used in the resource result code template).
No results matching your search criteria were found.
$(if) $(result_count) greater than 0 $(then)Below are our suggestions for similar dates.<br/><br/>$(endif)
$(search.type=periods_day_range_ext7)
$(retry_search)
This is a small variation of the previous template. Here the text "Below are our suggestions for similar dates" will be displayed only if the retried (broader) search actually manages to find any results. Otherwise only "No results matching your search criteria" will be displayed. A conditional statement was used to accomplish this (more here). Please note that the tag $(result_count) used in this template always corresponds to the number of results in the retried search. The original search is known to have zero results.

Important: The ‘no matching results’ code will have no effect on the upcoming availability search. It will only be used with the other search modes.

<< Back to tutorials