-------------------------------- Title -------------------------------- Symphony URL Parameters: Managing Page Views -------------------------------- Description -------------------------------- Symphony URL Parameters allow a single page template to manage several different views of the XML data. Using XSLT and some flexible URL parameters, it is possible to filter entries by different sets of categories or other forms of metadata to create nested lists. This tutorial is in answer to a question about [filtering content](http://symphony-cms.com/forum/discussions/21790/) on the Symphony forum. -------------------------------- Body -------------------------------- When creating a page template, specify URL parameters to be able to control different page views, depending on the value of each URL parameter. If the URL Parameters `a/b` have been specified in the page template, you could display a couple links to select two different overviews. Let’s assume that a site needs to display a list of products which can be viewed by category or by material. One strategy might be to create three sections: one for Categories and another for Materials, then a separate section for Products. The Products section could include two Select Box Link fields: one called Category linked to the Title field of the Categories section, and one called Material linked to the Title field of the Materials section. Create three data sources for the overviews that include the elements that would display on an overview page: Products, Categories and Materials. #### Creating Lists with XSLT List the products by category by first creating a list of the categories:

Categories

A list of the materials would be similar:

Materials

##### Lists of Lists Use a named template to call a list of products for each category, and another to call a list of products for each material:
  • ##### Products by Category Call the “products-by-category” template to create a list of products organized by category:

    Categories

    ##### Products by Material Call the “products-by-material” template to create a list of products organized by material:

    Materials

    #### A Named Template to Display Entries Create a named template for displaying each product entry:

    #### Managing Page Views Then, create the logic to display each view by using an `xsl:choose` instruction:

    #### Data Source Optimization These templates use XSLT to filter entries. To be able to display full entries for each product, it would be best to use data source filtering to ensure that the XML output is optimized in order to keep page load times as fast as possible. With different data sources, adjust the XPath expressions to select the appropriate XML nodes. Read more about [Symphony Data Sources](http://www.designprojectx.com/tutorials/symphony-data-sources/) or refer to the [Symphony documentation](http://symphony-cms.com/documentation/interface/). -------------------------------- Date -------------------------------- 22 May 2009 9:50am -------------------------------- Section -------------------------------- Tutorials -------------------------------- Category -------------------------------- Technology -------------------------------- Tags -------------------------------- symphony cms, xslt