Knowledge Base - Tutorial : Radius Search Application
Insert application code in vCard template and search form ?
In order to turn on the Radius Search Application you need to insert some lines of code into the search template (mandatory) and the vCard templates (optional) as follows :
- Browse to the SobiPro administrator section where the application is published
- Browse the Section template manager and open the "search" folder under "Section Templates"
- Click on the "view.xsl" file and add the appropriate code as described below
- If you want to display the distance from center, you need to edit the vCard template as well as described
Note : see the Sobipro editor's site (Sigsiu.net) to learn more how to edit templates.
The following captures of the code locations are samples. You can move the code where you want and experiment with different locations, but the included examples fit the 3 most common search form scenarios. Only one of them is required.
To display the search fields into the search form, add following code into your search form view template:
- <xsl:value-of select="mjradius" disable-output-escaping="yes" />
To show the distances into the search results vCards, add this code into your V-Card template:
- <xsl:value-of select="mjradius" disable-output-escaping="yes" /> (if you use html text in language file - default)
- <xsl:value-of select="mjradius" /> (use is you have simple text)
Note : the Radius Search Application isn't a custom field like some other Sobipro fields (it save nothing in entries), but is an application. This is the reason why you cannot select the position through the custom fields.
Note : the radius search field can be in the extended search part of the search form. In this case the radius search field is not visible at form loading, and you need to click the 'Extended Search' button.
Search form template
Sobipro Radius Search - Application