Local Knowledge Repeater

Repeaters are useful when N type searches are needed in Local Knowledge (eg NearestN or Distance). NearestN is a number type (say nearest 5 schools). The repeater “repeats” or loops the question/search until it finds 5 .

To list the results of the FMN search, use the Local Knowledge Repeater.

Begin by creating a new template using Add Template”

After you have added some introductory text such as “Your nearest supermarkets are:” select the Insert Local Knowledge Repeater button.

  • Choose Items from the Repeated Type dropdown menu. Choose Attributes from the Item Property menu.
  • Click OK to add the repeater code.
  • The following line of code appears:
  • {Attributes[ATTRIBUTE_NAME_TO_REPLACE]}
  • Replace ATTRIBUTE_NAME_TO_REPLACE with the name of the column you are searching.
  • When this template is added to Local Knowledge, it will produce a static list of results.

In the next example, you can build a list that will link to a Full Template.

Insert Local Knowledge Repeater – a list with a link to a Full Template

To create a list of results that has a hyperlink to a Full Template, simply add a bit of code to the existing template.

  • From the drop-down menu select Template > Manage Templates.
  • Click Edit on your required template.
  • On the Tools menu, select <> Source code.
  • You can alter the source code by embedding the following line:
  • <div class="FMNItem"><a href="javascript:zoomToFMNItem({OverlayNo}, '{escape(Name)}')"></a></div>

The before and after code is shown below:

Before

<p><img src="img/uploads/MapPinGenericRed.png" alt="MapPinGenericRed.png" width="24" height="24" />
The 5 nearest supermarkets are:&nbsp;</p>
<repeater itemtype="Items">
<div>{Attributes[CombinedName]}</div>
</repeater>

After

<p><img src="img/uploads/MapPinGenericRed.png" alt="MapPinGenericRed.png" width="24" height="24" />
The 5 nearest supermarkets are:&nbsp;</p>
<repeater itemtype="Items">
<div><a href="javascript:zoomToFMNItem({OverlayNo}, '{escape(Name)}')"> {Attributes[CombinedName]}</a></div>
</repeater>

Click OK when you have completed the changes.

The Template dialog will show the repeater code as a hyperlink.

When this template is added to the Local Knowledge it will produce a hyperlink list of results.

To complete the links, build the Full Template.