Default locations

Permalink Browser Info Environment
I do have one question, my client has several locations all in about 100 mile radius. Is there a way that all of those locations can show on the map by default without having to enter a zip code first?

Thanks!

Type: Discussion
Status: In Progress
FatTony1952
View Replies: View Best Answer
ryan replied on at Permalink Reply
ryan
If you override the view template you can probably just set the correct values for the radius and address fields with javascript or php, then in the document.ready function you could call the searchLocations function which would be the same as submitting the form.

<script>
$(document).ready(function (){
   load<?php echo $controller->bID?>();
        // set the form fields with with js
       searchLocations();// call the search locations function
});
</script>
FatTony1952 replied on at Permalink Reply
FatTony1952
I'll give that a shot. This won't affect the search capabilities will it, should someone use the search function?
ryan replied on at Permalink Reply
ryan
Not unless it's causing a javascript error..
FatTony1952 replied on at Permalink Reply
FatTony1952
Do you think it would be possible to call out a zip code in the load function at the beginning of the view.php file? I did modify the map's coordinates to zoom to the area I need by default.
ryan replied on at Permalink Reply
ryan
Yeah, my suggestion was to set the form fields with javascript or manually, then run the searchLocations function, that would search by zip or whatever.

Is that what you're looking for?
FatTony1952 replied on at Permalink Reply
FatTony1952
Yeah, I just need it to return a zip and radius on page load so that all the entered location show up without the user having to put in a zip first.

The way it is setup by default works great if you're company's locations are nationwide, but not really for a local company with say, 10 locations.
FatTony1952 replied on at Permalink Best Answer Reply
FatTony1952
Got it working.

This is the code I used:

$(document).ready(function (){
   load<?php echo $controller->bID?>();
        var address = $('#ccm-locator-search-<?php   echo $controller->bID?>  input[name=address]').val(ZipCode);
      var radius = $('#ccm-locator-search-<?php   echo $controller->bID?>  #radius').val(250);
       searchLocations();
});
CityMind replied on at Permalink Reply
CityMind
Tony,

Where did you put this code? Having trouble figuring out how to do the same thing on my site.

Lamar Brantley

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.