Translations of this page:

How to Use Variables in a Template

Each information associated with a marker can be used as a “variable”: the marker's title, its description, its geographical coordinates, etc. Let's look more closely at the example below:

California Real Estate

In this example, several home-related markers are stored in a group named San Diego that is part of the map named California Real Estate; the title of the first marker is Single-family home: each of these elements corresponds to a viariable that can be used in numerous ways. Whenever you want to insert the name of the group to which a marker belongs, you can use the $group variable. This also ensures that the group name is automatically updated when you modify it. To insert the title of a marker, you can use the $title variable, etc.

Note: Default Click2Map variables start with the $ character and can be used in almost all text and Html fields. Custom variables start with the # character. For a list of the default variables, see: Click2Map Variables.

In the following step by step tutorial, we'll modify our Real Estate marker template so that all the markers created from it include a Photo tab, the legend of which being a combination of the marker's title and the name of the group in which it is stored.

Step 1: Creating the Marker Template

The New Template dialog box

  1. In Click2Map's main menu, use the Tools > Template Set command to open the Template Set dialog box.
  2. Click on the Add… button to open the New Template dialog box.
  3. Enter the following information:
    • Template Name: Enter here the name of you template, for example, Real Estate.
    • Marker address: Check this option to make sure all the markers created from you template include an address section.
    • Change marker icon: Click on this button to change the icon that should be used by all the markers created from this template. Please select an icon different from the default icon.
  4. The Additional Properties tabClick on the Additional Properties tab and enter the following information (see: The Template dialog box for more detailed information):
    • Check the Web link option and enter the link properties below:
      • URL Address: To associate a default Web address with all the markers created with this template, enter it here. We'll simply enter http://www.click2map.com.
      • Link text: To create a hyperlink to the URL Address entered above and display it instead of the link code, we'll enter Click2Map Website here.
    • Check the E-mail link option and enter the link properties below:
      • E-mail address: To associate a default e-mail address with all the markers created with this template, we'll enter contact@click2map.com here.
      • Link text: To create a hyperlink to the e-mail address entered above and display it instead of the link code, we'll enter the text Contact Us here.
    • Tags: We'll then associate text tags or keywords with all the markers generated with this template. To do so, we'll simply enter the desired tags here: California, Real Estate, Click2Map.
  5. Click on the OK button to save your marker template.

Step 2: Adding Variables to the Marker Template

  1. If the Real Estate template previously created isn't yet opened:
    • Use the Tools > Template Set command from Click2Map's main menu to open the Template Set dialog box.
    • Click on the Real Estate icon to select it, then click on the Edit button to open the Template dialog box.
  2. Click on the Extra Tabs tab.
  3. Click on the Photo button present in the New Tab section.
  4. In the Legend text area, enter: “A wonderful $title in the $group area.”
  5. Click on the OK button to save your marker template.
  6. Click on the Close button do close the Template Set dialog box.

Step 3: Creating a Marker from a Template

  1. In the Map Explorer, select the Condo group in the Real Estate map. We'll add a marker in this group.
  2. Use the New > Marker from Template command from Clic2Map's main menu to open the Template Set.
  3. In the Template Set dialog box, select the Real Estate template you previously created and click on the OK button to activate it.
  4. In the Marker Properties tab, enter the following information:
    • Title: Condo, East Boston, 150sq ft.
    • Description: Your description goes here.
    • Address: 69 Paris Street Boston, MA 02128
  5. Click on the Geocode button.
  6. Click on the Extra Tabs tab
    • File: Select a photo on your hard drive and click on the Upoad button or enter the full URL address of an image and click on the Load button.
  7. Click on the OK button to save your marker.

When you click on the marker and display its information window, the two variables present in the legend associated with the photo are automatically replaced by the proper data, like in the example below:

Variables

The same thing will happen for all the markers you will create based on this marker template.

Important: Modifying a marker template has no effect on the markers that have already been created with the template. To apply a template to existing markers, use Bulk Operations.

 
how_to_use_variables_in_a_template.txt · Last modified: 2009/02/11 10:31 by admin
 
Recent changes RSS feed