image of logo

User Guide: Integrating a Store Locator in SilverstripeCMS

1.0 Overview

This guide provides MapCosmos users with the technical steps to integrate the MapCosmos store locator widget into a Silverstripe CMS project.

2.0 Prerequisites

Before beginning the integration, ensure you have the following:

  • An active Silverstripe CMS installation.
  • Administrator or developer-level permissions to modify Silverstripe page types and templates.
  • A MapCosmos account with a fully configured store locator widget.

3.0 Integration Procedure

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.

3.1 Copy the widget installation code from MapCosmos

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.

Copying the MapCosmos store locator installation code into SilverStripe CMS.

3.2 Implementation in Silverstripe

  1. Create a Page Type: For best practice and maintainability, it is recommended to create a new page type in your Silverstripe project (e.g., StoreLocatorPage.php).
  2. Create the Page: In the Silverstripe CMS admin panel, create a new page using your StoreLocatorPage type.
  3. Embed in Template: Open the corresponding template file (e.g., StoreLocatorPage.ss). Paste the embed code copied from MapCosmos into the main content area of your template.
<%-- 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>

4.0 Verification

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.

5.0 Enabled Functionality

Upon successful integration, your website's users will have access to a full-featured store locator where they can:

  • Discover nearby stores instantly.
  • Filter locations by specific products, services, categories, opening times, distance, and much more.
  • Get one-click directions through online maps.
  • Access customized, rich details about your local stores.
See all integrations

Other platforms

Interested in MapCosmos?
The first 7 days are on us
Free hands on boarding & support
No credit card required!

Interested in MapCosmos? See it in action!

The first 7 days are on us
Free hands on boarding & support
No credit card required!
Interested in MapCosmos?
The first 7 days are on us
Free hands on boarding & support
No credit card required!