This guide provides MapCosmos users with the technical steps to integrate the MapCosmos store locator widget into a Silverstripe CMS project.
Before beginning the integration, ensure you have the following:
The integration is a two-stage process. First, the widget is configured in MapCosmos, and then the generated code is embedded into a Silverstripe template.
You can generate the necessary embed code within the MapCosmos platform. For a comprehensive walkthrough of how to set up your MapCosmos widget, please refer to our detailed guide on generating the installation code.
<%-- templates/Layout/StoreLocatorPage.ss --%>
<div class="container">
<h1>Our Locations</h1>
<p>Find a location near you.</p>
<%-- Paste the MapCosmos embed code here --%>
</div>
After embedding the code, clear the Silverstripe cache by navigating to your site's URL and adding ?flush=1 to the end. View the new Store Locator page on the front end to confirm that the interactive map is loading and functioning as expected.
Upon successful integration, your website's users will have access to a full-featured store locator where they can: