Technical Support
posted this on February 16, 2009 16:54
Displaying a list of products related to the currently-open hotel or package can be an interesting feature you can easily implement in your portal through TouristWay SDK.
In the catalogue administration area you bind each product to a location (i.e. city) which is usually en element of a tree of destinations.
You can access the information about the "parents" of the location where your product is based through the following fields:
%-product.locarea1des-%: First level of the tree (usually Country)
%-product.locarea2des-%: Second level of the tree (usually Region)
%-product.locarea3des-%: Third level of the tree (usually Province)
%-product.locarea4des-%: Fourth level of the tree (usually Area)
for each of these labels TouristWay has also codes that can be used as destination filters in any search-enabled component, for example "showcase":
%-product.locarea1code-%
%-product.locarea2code-%
%-product.locarea3code-%
%-product.locarea4code-%
You probably figured out already how to use this information in your showcase, however here is a real-world example:
<component id="contextual" class="showcase">
<catalogue>accommodation</catalogue>
<destination>P~%-components.closeup.product.locarea1code-%</destination>
<itemsperpage>5</itemsperpage>
<usetemplate>%-system.lngtemplatepath-%hlib/comm/showcase-flyers.html</usetemplate>
<renderto>component_contextual</renderto>
<datasetalias>
<alias id="results">components.contextual.results</alias>
</datasetalias>
</component>
This will retrieve five hotels (accommodation) in the same country of the currently-opened product.
IMPORTANT: Please note the "P~" symbol before the actual code of the destination. This symbol instruct TouristWay to treat the provided code as a group of locations and is required to filter by anything that has been loaded in the catalogue administration area as "Zone" (Zones indeed are meant to group locations in tree-like structures).