Developer forum

Forum » Templates » Maps template...again

Maps template...again

Giuseppina Giunta
Reply

Hi,

the code in the map template shows only these user address data:                   

<!--@Name--><!--@Address--><!--@Address2--><!--@Zip--><!--@City--><!--@Country--><!--@Phone-->

But I should show all the other user data:

<!--@PhonePriv--><!--@Mobile--><!--@City_Code--><!--@Information--><!--@Web-->

I have added them in the maps.html template, but they are not showing online

http://scolopi.net.dynamicweb-cms.com/Default.aspx?ID=789&Purge=True

Why? What can I do?

I would also like know if/how I can display users address list by country.

Thank you!

Giuseppina


Replies

 
Mikkel Ricky
Reply

Try adding <!--@DwTemplateTags--> inside <!--@LoopStart(Locations)--> … <!--@LoopEnd(Locations)-->. Then you'll get a list of all template tags that are available inside the loop. (For performance reasons, you should only display a few locations when using @DwTemplateTags in the template.)

If you add a data-sort-value attribute to the locations, they will be sorted by this value:

            <li … data-sort-value="<!--@Country-->">

Check out the templates in Templates/Maps/templates/ for more examples of what you can do with the Maps templates.

Best regards,
Mikkel

 

 

 
Giuseppina Giunta
Reply

Hi, thank you, but I don't need to sort data by country but I am trying to add a control to my map to give a list of countries
select boxes to browse data by country. Can I do this?

Thank you.
Best regards.
Giuseppina

 

 
Mikkel Ricky
Reply

You can filter the map locations by anything. Just add the country as filter value

<li ... data-filter-value="<!--@Country-->" ...> ... </li>

and generate filter buttons with available countries

<div class="locations-filter">
  <button data-filter-value="Denmark">Denmark</button>
  ...
  <button data-filter-value="*"><!--@Translate(Show_all, "Show all")--></button>
</div>

Best regards,
Mikkel

 
Giuseppina Giunta
Reply

Hi,

with that filter code I have this result:

http://scolopi.net.dynamicweb-cms.com/Default.aspx?ID=791&Purge=True

Only "Show all" button works.

Also I would show the country list in a select box instead of buttons...

Please take a look at my code below and tell me where is the error and how I can create a filter on a select box like this:

http://www.geocodezip.com/zoom2countrySelectList.html

Thank you.

Best regards,

Giuseppina

p.s. This code provides basic functions so you could add it as a useful DW maps template ...

 

<div class="dynamicweb-map" id="<!--@ElementID-->" data-list-position="<!--@ListPosition-->">

    <form class="search">
        <div>
            <label for="dynamicweb-map-adr"><!--@Translate(Address, 'Address', Global)--></label>
            <input type="text" size="70" id="dynamicweb-map-adr" name="adr" placeholder="Address …" value="<!--@If Defined(Server:Request.adr)--><!--@Server:Request.adr--><!--@EndIf(Server:Request.adr)-->"/>
            <label for="dynamicweb-map-dst"><!--@Translate(Distance, 'Distance', Global)--></label>
            <select id="dynamicweb-map-dst" name="dst">
                <option value="1000">1 km</option>
                <option value="2000">2 km</option>
                <option value="4000">4 km</option>
                <option value="8000">8 km</option>
                <option value="16000">16 km</option>
                <option value="32000">32 km</option>
            </select>
            <button type="submit" data-search="distance"><!--@Translate(Search, 'Search', Global)--></button>
            <button type="reset"><!--@Translate(Reset_search, 'Reset search', Global)--></button>
            <button type="button" class="show-all-locations"><!--@Translate(Show_all_groups, 'Show all locations', Global)--></button>
        </div>
    </form>

      <div class="map" style="width: <!--@MapWidth-->; height: <!--@MapHeight-->;">
        <div id="<!--@MapElementID-->"></div>

    </div>


 

   
          <!--@LoopStart(UserGroups)-->
    <!--@HeaderStart-->
    <div class="group-filter user-Name" style="height:560px;">
      
    <!--@HeaderEnd-->
    <button class="buttonmap" data-group-id="<!--@ID-->">
        <!--@If Defined(Icon)--><img class="icon" src="<!--@Icon-->" /><!--@EndIf(Icon)-->
        <!--@Name--></button>

    <!--@FooterStart-->
    </div>
 
    <!--@FooterEnd-->
    <!--@LoopEnd(UserGroups)-->

 
 
 
 
 

  <div class="list">
        <ol id="<!--@ListElementID-->">
        <!--@LoopStart(Locations)-->
            <li data-lat="<!--@Lat-->" data-lng="<!--@Lng-->" data-title="<!--@Name-->"
                    data-group-id="<!--@GroupID-->"
                    <!--@If Defined(Icon)--> data-icon="<!--@Icon-->"<!--@EndIf(Icon)-->>
              <div class="name" style="size:16px;line-height:21px;"><strong><!--@Name--></strong></div>
                <!--@If(0=1)-->@see http://microformats.org/wiki/adr<!--@EndIf-->             
              <div class="adr" style="size:16px;line-height:21px;">
                    <div class="street-address"><!--@Address--></div>
                    <div class="extended-address"><!--@Address2--></div>
                    <span class="postal-code"><!--@Zip--></span>
                    <!--@If Defined(Custom.AccessUser_City_Code)--><span class="locality"><!--@Custom.AccessUser_City_Code--></span><!--@EndIf(Custom.AccessUser_City_Code)-->
                    <!--@If Defined(Custom.AccessUser_PostalBox)--><span class="locality"><!--@Custom.AccessUser_PostalBox--></span><!--@EndIf(Custom.AccessUser_PostalBox)-->
                    <span class="locality"><!--@City--></span>
                    <div class="country-name"><!--@Country--></div>
                <!--@If Defined(Phone)--><div class="Phone">Tel:<!--@Phone--></div><!--@EndIf(Phone)-->
<!--@If Defined(PhoneMobile)--><div class="Phone"><!--@PhoneMobile--></div><!--@EndIf(PhoneMobile)-->
<!--@If Defined(PhonePrivate)--><div class="Phone"><!--@PhonePrivate--></div><!--@EndIf(PhonePrivate)-->
                                <!--@If Defined(Fax)--><div class="Phone">Fax:<!--@Fax--></div><!--@EndIf(Fax)-->
                <!--@If Defined(Custom.AccessUser_Web)--><div class="locality">Web:<!--@Custom.AccessUser_Web--></div><!--@EndIf(Custom.AccessUser_Web)-->

                </div>
            </li>
          
            
 
            <!--@LoopEnd(Locations)-->
        </ol>
    </div>
 <li data-filter-value="<!--@Country-->"> Select a country </li>
          <div class="locations-filter">
 
  <button data-filter-value="Afghanistan">Afghanistan</button><button data-filter-value="Albania">Albania</button><button data-filter-value="Algeria">Algeria</button><button data-filter-value="American Samoa">American Samoa</button><button data-filter-value="Andorra">Andorra</button><button data-filter-value="Angola">Angola</button><button data-filter-value="Anguilla">Anguilla</button><button data-filter-value="Antarctica">Antarctica</button><button data-filter-value="Antigua and Barbuda">Antigua and Barbuda</button><button data-filter-value="Argentina">Argentina</button><button data-filter-value="Armenia">Armenia</button><button data-filter-value="Aruba">Aruba</button><button data-filter-value="Australia">Australia</button><button data-filter-value="Austria">Austria</button><button data-filter-value="Azerbaijan">Azerbaijan</button><button data-filter-value="Bahamas">Bahamas</button><button data-filter-value="Bahrain">Bahrain</button><button data-filter-value="Bangladesh">Bangladesh</button><button data-filter-value="Barbados">Barbados</button><button data-filter-value="Belarus">Belarus</button><button data-filter-value="Belgium">Belgium</button><button data-filter-value="Belize">Belize</button><button data-filter-value="Benin">Benin</button><button data-filter-value="Bermuda">Bermuda</button><button data-filter-value="Bhutan">Bhutan</button><button data-filter-value="Bolivia">Bolivia</button><button data-filter-value="Bosnia and Herzegovina">Bosnia and Herzegovina</button><button data-filter-value="Botswana">Botswana</button><button data-filter-value="Bouvet Island">Bouvet Island</button><button data-filter-value="Brazil">Brazil</button><button data-filter-value="British Indian Ocean Territory">British Indian Ocean Territory</button><button data-filter-value="Brunei Darussalam">Brunei Darussalam</button><button data-filter-value="Bulgaria">Bulgaria</button><button data-filter-value="Burkina Faso">Burkina Faso</button><button data-filter-value="Burundi">Burundi</button><button data-filter-value="Cambodia">Cambodia</button><button data-filter-value="Cameroon">Cameroon</button><button data-filter-value="Canada">Canada</button><button data-filter-value="Cape Verde">Cape Verde</button><button data-filter-value="Cayman Islands">Cayman Islands</button><button data-filter-value="Central African Republic">Central African Republic</button><button data-filter-value="Chad">Chad</button><button data-filter-value="Chile">Chile</button><button data-filter-value="China">China</button><button data-filter-value="Christmas Island">Christmas Island</button><button data-filter-value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</button><button data-filter-value="Colombia">Colombia</button><button data-filter-value="Comoros">Comoros</button><button data-filter-value="Congo">Congo</button><button data-filter-value="Congo, the Democratic Republic of the">Congo, the Democratic Republic of the</button><button data-filter-value="Cook Islands">Cook Islands</button><button data-filter-value="Costa Rica">Costa Rica</button><button data-filter-value="Cote D'Ivoire">Cote D'Ivoire</button><button data-filter-value="Croatia">Croatia</button><button data-filter-value="Cuba">Cuba</button><button data-filter-value="Cyprus">Cyprus</button><button data-filter-value="Czech Republic">Czech Republic</button><button data-filter-value="Denmark">Denmark</button><button data-filter-value="Djibouti">Djibouti</button><button data-filter-value="Dominica">Dominica</button><button data-filter-value="Dominican Republic">Dominican Republic</button><button data-filter-value="Ecuador">Ecuador</button><button data-filter-value="Egypt">Egypt</button><button data-filter-value="El Salvador">El Salvador</button><button data-filter-value="Equatorial Guinea">Equatorial Guinea</button><button data-filter-value="Eritrea">Eritrea</button><button data-filter-value="Estonia">Estonia</button><button data-filter-value="Ethiopia">Ethiopia</button><button data-filter-value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</button><button data-filter-value="Faroe Islands">Faroe Islands</button><button data-filter-value="Fiji">Fiji</button><button data-filter-value="Finland">Finland</button><button data-filter-value="France">France</button><button data-filter-value="French Guiana">French Guiana</button><button data-filter-value="French Polynesia">French Polynesia</button><button data-filter-value="French Southern Territories">French Southern Territories</button><button data-filter-value="Gabon">Gabon</button><button data-filter-value="Gambia">Gambia</button><button data-filter-value="Georgia">Georgia</button><button data-filter-value="Germany">Germany</button><button data-filter-value="Ghana">Ghana</button><button data-filter-value="Gibraltar">Gibraltar</button><button data-filter-value="Greece">Greece</button><button data-filter-value="Greenland">Greenland</button><button data-filter-value="Grenada">Grenada</button><button data-filter-value="Guadeloupe">Guadeloupe</button><button data-filter-value="Guam">Guam</button><button data-filter-value="Guatemala">Guatemala</button><button data-filter-value="Guinea">Guinea</button><button data-filter-value="Guinea-Bissau">Guinea-Bissau</button><button data-filter-value="Guyana">Guyana</button><button data-filter-value="Haiti">Haiti</button><button data-filter-value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</button><button data-filter-value="Holy See (Vatican City State)">Holy See (Vatican City State)</button><button data-filter-value="Honduras">Honduras</button><button data-filter-value="Hong Kong">Hong Kong</button><button data-filter-value="Hungary">Hungary</button><button data-filter-value="Iceland">Iceland</button><button data-filter-value="India">India</button><button data-filter-value="Indonesia">Indonesia</button><button data-filter-value="Iran, Islamic Republic of">Iran, Islamic Republic of</button><button data-filter-value="Iraq">Iraq</button><button data-filter-value="Ireland">Ireland</button><button data-filter-value="Israel">Israel</button><button data-filter-value="Italy">Italy</button><button data-filter-value="Jamaica">Jamaica</button><button data-filter-value="Japan">Japan</button><button data-filter-value="Jordan">Jordan</button><button data-filter-value="Kazakhstan">Kazakhstan</button><button data-filter-value="Kenya">Kenya</button><button data-filter-value="Kiribati">Kiribati</button><button data-filter-value="Korea, Democratic People's Republic  of">Korea, Democratic People's Republic  of</button><button data-filter-value="Korea, Republic of">Korea, Republic of</button><button data-filter-value="Kuwait">Kuwait</button><button data-filter-value="Kyrgyzstan">Kyrgyzstan</button><button data-filter-value="Lao People's Democratic Republic">Lao People's Democratic Republic</button><button data-filter-value="Latvia">Latvia</button><button data-filter-value="Lebanon">Lebanon</button><button data-filter-value="Lesotho">Lesotho</button><button data-filter-value="Liberia">Liberia</button><button data-filter-value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</button><button data-filter-value="Liechtenstein">Liechtenstein</button><button data-filter-value="Lithuania">Lithuania</button><button data-filter-value="Luxembourg">Luxembourg</button><button data-filter-value="Macao">Macao</button><button data-filter-value="Macedonia, the Former Yugoslav Republic of">Macedonia, the Former Yugoslav Republic of</button>
  <button data-filter-value="Madagascar">Madagascar</button><button data-filter-value="Malawi">Malawi</button><button data-filter-value="Malaysia">Malaysia</button><button data-filter-value="Maldives">Maldives</button>
  <button data-filter-value="Mali">Mali</button><button data-filter-value="Malta">Malta</button><button data-filter-value="Marshall Islands">Marshall Islands</button>
  <button data-filter-value="Martinique">Martinique</button><button data-filter-value="Mauritania">Mauritania</button>
  <button data-filter-value="Mauritius">Mauritius</button><button data-filter-value="Mayotte">Mayotte</button><button data-filter-value="Mexico">Mexico</button>
    <button data-filter-value="Micronesia, Federated States of">Micronesia, Federated States of</button><button data-filter-value="Moldova, Republic of">Moldova, Republic of</button><button data-filter-value="Monaco">Monaco</button><button data-filter-value="Mongolia">Mongolia</button><button data-filter-value="Montserrat">Montserrat</button><button data-filter-value="Morocco">Morocco</button><button data-filter-value="Mozambique">Mozambique</button><button data-filter-value="Myanmar">Myanmar</button><button data-filter-value="Namibia">Namibia</button><button data-filter-value="Nauru">Nauru</button><button data-filter-value="Nepal">Nepal</button><button data-filter-value="Netherlands">Netherlands</button><button data-filter-value="Netherlands Antilles">Netherlands Antilles</button><button data-filter-value="New Caledonia">New Caledonia</button><button data-filter-value="New Zealand">New Zealand</button><button data-filter-value="Nicaragua">Nicaragua</button><button data-filter-value="Niger">Niger</button><button data-filter-value="Nigeria">Nigeria</button><button data-filter-value="Niue">Niue</button><button data-filter-value="Norfolk Island">Norfolk Island</button><button data-filter-value="Northern Mariana Islands">Northern Mariana Islands</button><button data-filter-value="Norway">Norway</button><button data-filter-value="Oman">Oman</button><button data-filter-value="Pakistan">Pakistan</button><button data-filter-value="Palau">Palau</button><button data-filter-value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</button><button data-filter-value="Panama">Panama</button><button data-filter-value="Papua New Guinea">Papua New Guinea</button><button data-filter-value="Paraguay">Paraguay</button><button data-filter-value="Peru">Peru</button><button data-filter-value="Philippines">Philippines</button><button data-filter-value="Pitcairn">Pitcairn</button><button data-filter-value="Poland">Poland</button><button data-filter-value="Portugal">Portugal</button><button data-filter-value="Puerto Rico">Puerto Rico</button><button data-filter-value="Qatar">Qatar</button><button data-filter-value="Reunion">Reunion</button><button data-filter-value="Romania">Romania</button><button data-filter-value="Russian Federation">Russian Federation</button><button data-filter-value="Rwanda">Rwanda</button><button data-filter-value="Saint Helena">Saint Helena</button><button data-filter-value="Saint Kitts and Nevis">Saint Kitts and Nevis</button><button data-filter-value="Saint Lucia">Saint Lucia</button><button data-filter-value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</button><button data-filter-value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</button><button data-filter-value="Samoa">Samoa</button><button data-filter-value="San Marino">San Marino</button><button data-filter-value="Sao Tome and Principe">Sao Tome and Principe</button><button data-filter-value="Saudi Arabia">Saudi Arabia</button><button data-filter-value="Senegal">Senegal</button><button data-filter-value="Serbia and Montenegro">Serbia and Montenegro</button><button data-filter-value="Seychelles">Seychelles</button><button data-filter-value="Sierra Leone">Sierra Leone</button><button data-filter-value="Singapore">Singapore</button><button data-filter-value="Slovakia">Slovakia</button><button data-filter-value="Slovenia">Slovenia</button><button data-filter-value="Solomon Islands">Solomon Islands</button><button data-filter-value="Somalia">Somalia</button><button data-filter-value="South Africa">South Africa</button><button data-filter-value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</button><button data-filter-value="Spain">Spain</button><button data-filter-value="Sri Lanka">Sri Lanka</button><button data-filter-value="Sudan">Sudan</button><button data-filter-value="Suriname">Suriname</button><button data-filter-value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</button><button data-filter-value="Swaziland">Swaziland</button><button data-filter-value="Sweden">Sweden</button><button data-filter-value="Switzerland">Switzerland</button><button data-filter-value="Syrian Arab Republic">Syrian Arab Republic</button><button data-filter-value="Taiwan, Province of China">Taiwan, Province of China</button><button data-filter-value="Tajikistan">Tajikistan</button><button data-filter-value="Tanzania, United Republic of">Tanzania, United Republic of</button><button data-filter-value="Thailand">Thailand</button><button data-filter-value="Timor-Leste">Timor-Leste</button><button data-filter-value="Togo">Togo</button><button data-filter-value="Tokelau">Tokelau</button><button data-filter-value="Tonga">Tonga</button><button data-filter-value="Trinidad and Tobago">Trinidad and Tobago</button><button data-filter-value="Tunisia">Tunisia</button><button data-filter-value="Turkey">Turkey</button><button data-filter-value="Turkmenistan">Turkmenistan</button><button data-filter-value="Turks and Caicos Islands">Turks and Caicos Islands</button><button data-filter-value="Tuvalu">Tuvalu</button><button data-filter-value="Uganda">Uganda</button><button data-filter-value="Ukraine">Ukraine</button><button data-filter-value="United Arab Emirates">United Arab Emirates</button><button data-filter-value="United Kingdom">United Kingdom</button><button data-filter-value="United States">United States</button><button data-filter-value="United States Minor Outlying Islands">United States Minor Outlying Islands</button><button data-filter-value="Uruguay">Uruguay</button><button data-filter-value="Uzbekistan">Uzbekistan</button><button data-filter-value="Vanuatu">Vanuatu</button><button data-filter-value="Venezuela">Venezuela</button><button data-filter-value="Viet Nam">Viet Nam</button><button data-filter-value="Virgin Islands, British">Virgin Islands, British</button><button data-filter-value="Virgin Islands, U.s.">Virgin Islands, U.s.</button><button data-filter-value="Wallis and Futuna">Wallis and Futuna</button><button data-filter-value="Western Sahara">Western Sahara</button><button data-filter-value="Yemen">Yemen</button><button data-filter-value="Zambia">Zambia</button><button data-filter-value="Zimbabwe">Zimbabwe</button>
 
  <button data-filter-value="*"><!--@Translate(Show_all, "Show all")--></button>
</div>
    <!--@If(NumberOfLocations=0)-->
    <div class="info"><!--@Translate(No_locations_found, 'No locations found')--></div>
    <!--@EndIf-->
</div>

 

 
Mikkel Ricky
Reply

As shown in my example you have to use data-filter-value attributes on your filter buttons and location elements to make it work.

If you want to use a dropdown to filter locations, yan have to add data-filter-value attributes to the option elements:

<div class="locations-filter">
  <select>
    <option data-filter-value="*"><!--@Translate(Show_all, "Show all")--></option>
    <option data-filter-value="Denmark">Denmark</option>
    ...
  </select>
</div>

 

 
Giuseppina Giunta
Reply

Hi, I have added two filter, data-filter-value="<!--@Country-->" data-filter-value="<!--@GroupName-->", but only country filter works:

http://scolopi.net.dynamicweb-cms.com/Default.aspx?ID=791&Purge=True

Why?

Thank you.

Giuseppina

<div class="dynamicweb-map" id="<!--@ElementID-->" data-list-position="<!--@ListPosition-->">
    <form class="search">
        <div>
            <label for="dynamicweb-map-adr"><!--@Translate(Address, 'Address')--></label>
            <input type="text" size="70" id="dynamicweb-map-adr" name="adr" placeholder="Address …" value="<!--@If Defined(Server:Request.adr)--><!--@Server:Request.adr--><!--@EndIf(Server:Request.adr)-->"/>
            <label for="dynamicweb-map-dst"><!--@Translate(Distance, 'Distance')--></label>
            <select id="dynamicweb-map-dst" name="dst">
                <option value="1000">1 km</option>
                <option value="2000">2 km</option>
                <option value="4000">4 km</option>
                <option value="8000">8 km</option>
                <option value="16000">16 km</option>
                <option value="32000">32 km</option>
            </select>
            <button type="submit" data-search="distance"><!--@Translate(Search, 'Search')--></button>
            <button type="reset"><!--@Translate(Reset_search, 'Reset search')--></button>
            <button type="button" class="show-all-locations"><!--@Translate(Show_all_locations, 'Show all locations')--></button>
        </div>
    </form>

    <div class="map" style="width: <!--@MapWidth-->; height: <!--@MapHeight-->;">
        <div id="<!--@MapElementID-->"></div>
    </div>

    <!--@FooterEnd-->
    <!--@LoopEnd(UserGroups)-->
    <div class="list">
        <ol id="<!--@ListElementID-->">
        <!--@LoopStart(Locations)-->
            <li data-lat="<!--@Lat-->" data-lng="<!--@Lng-->" data-title="<!--@Name-->" data-filter-value="<!--@Country-->" data-filter-value="<!--@GroupName-->"
                <!--@If Defined(Icon)--> data-icon="<!--@Icon-->"<!--@EndIf(Icon)-->>
                <div class="name"><!--@Name--><!--@If Defined(IsGroup)--> [group]<!--@EndIf(IsGroup)--></div>
                <!--@If Defined(GroupName)-->
                <div class="group">(<!--@GroupName-->)</div>
                <!--@EndIf(GroupName)-->
                <!--@If(0=1)-->@see http://microformats.org/wiki/adr<!--@EndIf-->
                <div class="adr">
                    <div class="street-address"><!--@Address--></div>
                    <div class="extended-address"><!--@Address2--></div>
                    <span class="postal-code"><!--@Zip--></span>
                    <span class="locality"><!--@City--></span>
                    <div class="country-name"><!--@Country--></div>
                </div>
            </li>
            <!--@LoopEnd(Locations)-->
        </ol>
    </div>
      <div class="locations-filter">
        <select>
            <option data-filter-value="*">
                <!--@Translate(Show_all, "Show all")-->
            </option>
            <option data-filter-value=''>Select a country....</option>
            <option data-filter-value="Italia">Italy</option>
            <option data-filter-value="Polska">Poland</option>
            <option data-filter-value="Brasil">Brasile</option>
            <option data-filter-value="España">Spain</option>

        </select>
           </div>
        <div class="group-filter user-Name">
                <select>

<option data-filter-value=''>Select a Department</option>
<option data-filter-value='Accoglienza_Alloggio'>Accoglienza/Alloggio</option>
<option data-filter-value='Aspirantato'>Aspirantato</option>
<option data-filter-value='Attivita_Programmi'>Attività/Programmi</option>
<option data-filter-value='Case_religiose'>Case religiose</option>
<option data-filter-value='Centro_culturale'>Centro culturale</option>
<option data-filter-value='Centro_sociale'>Centro sociale</option>
<option data-filter-value='Centro_sportivo'>Centro sportivo</option>
<option data-filter-value='Chiesa'>Chiesa</option>
<option data-filter-value='Comunita'>Comunità</option>
<option data-filter-value='Convitto'>Convitto</option>
<option data-filter-value='Curia'>Curia</option>
<option data-filter-value='Doposcuola'>Doposcuola</option>
<option data-filter-value='Casa_Editrice'>Casa Editrice</option>
<option data-filter-value='Fondazione'>Fondazione</option>
<option data-filter-value='Formazione_professionale'>Formazione professionale</option>
<option data-filter-value='Fraternita'>Fraternità</option>
<option data-filter-value='Fraternita_scolopiche'>Fraternità scolopiche</option>
<option data-filter-value='Hogar'>Hogar</option>
<option data-filter-value='Luoghi_del_culto'>Luoghi del culto</option>
<option data-filter-value='Noviziato'>Noviziato</option>
<option data-filter-value='Opere'>Opere</option>
<option data-filter-value='Parrocchia'>Parrocchia</option>
<option data-filter-value='Prenoviziato'>Prenoviziato</option>
<option data-filter-value='Scuola'>Scuola</option>
<option data-filter-value='Studentato'>Studentato</option>
<option data-filter-value='Universita'>Università</option>
        </select>
    </div>
    <!--@If(NumberOfLocations=0)-->
    <div class="info"><!--@Translate(No_locations_found, 'No locations found')--></div>
    <!--@EndIf-->
</div>

<script>
Dynamicweb.MapSettings = {
    list: {
        showOnlyLocationsOnMap: true
    },
    search: {
        circleOptions: {
            fillColor: '#00ff00'
        }
    }
}</script>
<!--@InitScript-->

 
Mikkel Ricky
Reply

HTML elements can only have one data-filter-value attribute so you have to write something like

<li … data-filter-value="<!--@GroupName--> <!--@Country-->" …/>

 

 
Giuseppina Giunta
Reply

Done, but it doesn't work...Why?

http://scolopi.net.dynamicweb-cms.com/Default.aspx?ID=792&Purge=True

Thank you
Giuseppina

 

<div class="dynamicweb-map" id="<!--@ElementID-->" data-list-position="<!--@ListPosition-->">

    <form class="search">
        <div>
            <label for="dynamicweb-map-adr"><!--@Translate(Address, 'Address', Global)--></label>
            <input type="text" size="70" id="dynamicweb-map-adr" name="adr" placeholder="Address …" value="<!--@If Defined(Server:Request.adr)--><!--@Server:Request.adr--><!--@EndIf(Server:Request.adr)-->"/>
            <label for="dynamicweb-map-dst"><!--@Translate(Distance, 'Distance', Global)--></label>
            <select id="dynamicweb-map-dst" name="dst">
                <option value="1000">1 km</option>
                <option value="2000">2 km</option>
                <option value="4000">4 km</option>
                <option value="8000">8 km</option>
                <option value="16000">16 km</option>
                <option value="32000">32 km</option>
            </select>
            <button type="submit" data-search="distance"><!--@Translate(Search, 'Search', Global)--></button>
            <button type="reset"><!--@Translate(Reset_search, 'Reset search', Global)--></button>
            <button type="button" class="show-all-locations"><!--@Translate(Show_all_groups, 'Show all locations', Global)--></button>
                    
        </div>
    </form>


      <div class="map" style="width: <!--@MapWidth-->; height: <!--@MapHeight-->;">
        <div id="<!--@MapElementID-->"></div>

    </div>

     
    <div class="list">
        <ol id="<!--@ListElementID-->">
        <!--@LoopStart(Locations)-->
            <li data-lat="<!--@Lat-->" data-lng="<!--@Lng-->" data-title="<!--@Name-->" data-filter-value="<!--@Country--><!--@GroupName-->"
                <!--@If Defined(Icon)--> data-icon="<!--@Icon-->"<!--@EndIf(Icon)-->>
                <div class="name"><!--@Name--><!--@If Defined(IsGroup)--> [group]<!--@EndIf(IsGroup)--></div>
                <!--@If Defined(GroupName)-->
                <div class="group">(<!--@GroupName-->)</div>
                <!--@EndIf(GroupName)-->
                <!--@If(0=1)-->@see http://microformats.org/wiki/adr<!--@EndIf-->
                <div class="adr">
                    <div class="street-address"><!--@Address--></div>
                    <div class="extended-address"><!--@Address2--></div>
                    <span class="postal-code"><!--@Zip--></span>
                    <span class="locality"><!--@City--></span>
                    <div class="country-name"><!--@Country--></div>
                </div>
            </li>
            <!--@LoopEnd(Locations)-->
        </ol>
    </div>
      <div class="locations-filter">
        <select>
            <option data-filter-value="*">
                <!--@Translate(Show_all, "Show all")-->
            </option>
            <option data-filter-value=''>Select a country....</option>
            <option data-filter-value="Italia">Italy</option>
            <option data-filter-value="Polska">Poland</option>
            <option data-filter-value="Brasil">Brasile</option>
            <option data-filter-value="España">Spain</option>

        </select>

                <select>
<option data-filter-value=''>Select a Department</option>
<option data-filter-value='Accoglienza_Alloggio'>Accoglienza/Alloggio</option>
<option data-filter-value='Aspirantato'>Aspirantato</option>
<option data-filter-value='Attivita_Programmi'>Attività/Programmi</option>
<option data-filter-value='Case_religiose'>Case religiose</option>
<option data-filter-value='Centro_culturale'>Centro culturale</option>
<option data-filter-value='Centro_sociale'>Centro sociale</option>
<option data-filter-value='Centro_sportivo'>Centro sportivo</option>
<option data-filter-value='Chiesa'>Chiesa</option>
<option data-filter-value='Comunita'>Comunità</option>
<option data-filter-value='Convitto'>Convitto</option>
<option data-filter-value='Curia'>Curia</option>
<option data-filter-value='Doposcuola'>Doposcuola</option>
<option data-filter-value='Casa_Editrice'>Casa Editrice</option>
<option data-filter-value='Fondazione'>Fondazione</option>
<option data-filter-value='Formazione_professionale'>Formazione professionale</option>
<option data-filter-value='Fraternita'>Fraternità</option>
<option data-filter-value='Fraternita_scolopiche'>Fraternità scolopiche</option>
<option data-filter-value='Hogar'>Hogar</option>
<option data-filter-value='Luoghi_del_culto'>Luoghi del culto</option>
<option data-filter-value='Noviziato'>Noviziato</option>
<option data-filter-value='Opere'>Opere</option>
<option data-filter-value='Parrocchia'>Parrocchia</option>
<option data-filter-value='Prenoviziato'>Prenoviziato</option>
<option data-filter-value='Scuola'>Scuola</option>
<option data-filter-value='Studentato'>Studentato</option>
<option data-filter-value='Universita'>Università</option>
        </select>
    </div>
    <!--@If(NumberOfLocations=0)-->
    <div class="info"><!--@Translate(No_locations_found, 'No locations found')--></div>
    <!--@EndIf-->
</div>

<script>
Dynamicweb.MapSettings = {
    list: {
        showOnlyLocationsOnMap: true
    },
    search: {
        circleOptions: {
            fillColor: '#00ff00'
        }
    }
}</script>
<!--@InitScript-->

 
Mikkel Ricky
Reply

You have to update your Maps.js library (get it from a recent release of Dynamicweb or from http://tech-conf-2014.dynamicweb-cms.com/Files/Templates/Maps/javascripts/Maps.js) and then use a comma-list af values in the data-filter-values attribute:

<li … data-filter-values="<!--@GroupName-->,<!--@Country-->" …/>

 

 
Giuseppina Giunta
Reply

Perfect!

Thank you.

Best regards

Giuseppina

 

You must be logged in to post in the forum