CM Map Locations (CMML) - Using Shortcodes


Shortcodes

Back to User Guide

TIP: What Are Shortcodes

Shortcodes add dynamic content to your site via a small piece of code. Learn more: Shortcodes - How To Use

What Are Shortcodes

Shortcodes allow you to add a dynamic map with your locations to posts and pages. There are different shortcodes depending on what you want to display. To use them, you must identify locations or categories by their IDs - learn how to display these in the edit pages.

Additionally, you can make them more specific by using parameters. For instance, you can use "category=tech" to only show that specific category.

Below, we list all the shortcodes and their parameters, along with samples to make it easier to understand. 

For reference, you can always find the list of shortcodes listed under the Shortcodes option.


Locations Shortcodes

1) Snippet

  • Shortcode: [cmloc-snippet]
  • Use: Displays a location's snippet. You can edit what is shown on the snippet under the Settings tab. Learn more by checking the related article on editing settings.
  • Filtering parameters:
    • id - set location ID to display specific location map
  • View paramteres:
    • featured - set the map to display interactive map or image for a static image
  • Sample: By using the shortcode [cmloc-snippet id="487" featured="map"], we are able to add a snippet of this location to the blog post.


2) A Specific Location Map

  • Shortcode: [cmloc-location-map]
  • Use: Shows a specific location on a map.
  • Filtering parameters:
    • id - location ID
  • View parameters:
    • theme - Choose between:
      • silver 
      • retro 
      • dark 
      • night 
      • aubergine
    • mapheight - the height of the map in pixels (decimal value without px string)
    • mapwidth - width of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)
    • showtitle - 0 for no, 1 for yes
    • showdate - 0 for no, 1 for yes
  • Sample: [cmloc-location-map id=1767 mapwidth=640 mapheight=480 width=700 showtitle=1 showdate=1]


3) Multiple Locations Map

  • Shortcode: [cmloc-locations-map]
  • Use: Displays maps with locations from a chosen category
  • Filtering parameters:
    • showonlybyparams - makes the index show only a specific map. Set as 1 in the page used for sharing locations. In technical terms, when enabled, the index will take the query of the URL in account
    • limit - the maximum number of locations (e.g. 5)
    • page - the maximum number of pages (e.g. 1)
    • category - set category ID/slug to displays locations from this category
    • taxonomy_key - set taxonomy key to displays locations from this custom taxonomy
  • View parameters:
    • theme - Choose between:
      • silver 
      • retro 
      • dark 
      • night 
      • aubergine
    • list - Choose between:
      • none
      • left
      • right
      • bottom
      • compact
    • mapwidth - width of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)
    • menu - show or hide a menu above the map with the buttons All locations, Add Locations and My Locations ("1" to show, "0" to hide)
    • tooltip - show or hide the info tooltip when a user clicks on a location  ("1" to show, "0" to hide) 
    • map - show or hide map ("1" to show, "0" to hide)
    • usertracking - show user track location/path ("1" to show, "0" to hide)
    • from_date - date format is ddmmyyyy. Note: this parameter was introduced in version 2.7.5
    • to_date - date format is ddmmyyyy. Note: this parameter was introduced in version 2.7.5
  • Get parameters:
    • bgcolor - add color
    • bgcolor_filter - show bgcolor filter ("1" to show, "0" to hide). Note: this parameter was introduced in version 2.7.5
    • time - add time such as l1, l3, l6, l12, p3, p6, p12
    • time_filter - show time filter ("1" to show, "0" to hide). Note: this parameter was introduced in version 2.7.5
    • identifier - add identifier
    • identifier_filter - show identifier filter ("1" to show, "0" to hide). Note: this parameter was introduced in version 2.7.5
    • from_date - date format is ddmmyyyy
    • to_date - date format is ddmmyyyy
    • hours - add hours such as 12, 24, 48
    • path - show path ("1" to show, "0" to hide)
  • Sample 1: With [cmloc-locations-map category="mountains"], we are able to display a map with all locations from a single category.

  • Sample 2: With [cmloc-locations-map list=left limit=4 page=1 category="111"], we can display the map with a list of locations.


4) Current Locations Map

  • Shortcode: [cmloc-current-locations-map]
  • Use: Shows the current locations maps
  • Filtering parameters:
    • limit - the maximum number of locations (e.g. 5)
    • page - the maximum number of pages (e.g. 1)
  • View parameters:
    • theme - Choose between:
      • silver 
      • retro 
      • dark 
      • night 
      • aubergine
    • mapwidth - width of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)
    • tooltip - show or hide the info tooltip when a user clicks on a location  ("1" to show, "0" to hide) 
  • Sample: [cmloc-current-locations-map theme='silver' limit=5 page=1 mapwidth=600 width=600 tooltip=0]

5) Locations Search

  • Shortcode: [cm-location-search]
  • Use: Shows a search form to find locations
  • Sample



6) My Locations Table

  • Shortcode: [my-locations-table]
  • Use: Displays the user's location table, the same that is showing up in the user's dashboard
  • Parameters:
    • controls - set "1" (default) if you want to show the "Edit" and "Delete" buttons for each location or "0" if you don't
    • addbtn - set "1" (default) if you want to show the "Add location" button or "0" if you don't
  • Sample: [my-locations-table controls=1 addbtn=1]



7) REST API

Note: this shortcode was introduced in version 3.0.8.

  • Shortcode: [cmloc_api]
  • Use: Enables or disables REST API.
  • Parameters
    • status - Set "on" to enable it and "off" to disable.
    • output - Set "1" to display the status of the API, and "0" to hide output. Default value is "1". Note: this parameter was introduced in version 3.0.9.
  • Samples: [cmloc_api status="on"] or [cmloc_api status="off"]

Integration Shortcodes

1) Common Map with Routes Integration

  • Shortcode: [cmmrm-cmloc-common-map]
  • Use: Displays a common map with locations and routes from the CM Map Routes Manager plugin
  • Filtering parameters:
    • showonlybyparams - makes the index show only a specific map. Set as 1 in the page used for sharing locations. In technical terms, when enabled, the index will take the query of the URL in account
    • categoryfilter - Show/Hide category filter above the map. 0 for hiding, 1 for showing. Includes categories for both plugins (Map Routes and Map Locations)
    • autoexpandcategoryfilter -  set "1" to expand the category filter by default. Only works if categoryfilter="1" 
    • categoryfilterautoselect - selects certain categories as soon as the page loads. Input the categories' id, separated by commas. Only works if categoryfilter="1" 
  • View parameters:
    • theme - Choose between:
      • silver 
      • retro 
      • dark 
      • night 
      • aubergine
    • path - set "1" if you want to display path or "0" if not.
    • mapheight - the height of the map in pixels (decimal value without px string)
    • mapwidth - width of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)
  • Sample: [cmmrm-cmloc-common-map path=1 categoryfilter=1 categoryfilterautoselect=1,5,22 mapwidth=900 mapheight=500 width=900]


2) Business Directory Integration

  • Shortcode: [cmloc-business]
  • Use: Displays map with the CM Business Directory records
  • Filtering parameters:
    • category - set business category to display business on the map
  • View parameters:
    • theme - Choose between:
      • silver 
      • retro 
      • dark 
      • night 
      • aubergine
    • categoryfilter - show or hide category filter over the map
    • searchbar - show or hide the search bar ("1" to show, "0" to hide)
    • mapheight - the height of the map in pixels (decimal value without px string)
    • mapwidth - width of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)
  • Sample: [cmloc-business category=tech categoryfilter=1 mapwidth=640 mapheight=480 width=700]


3) Expert Directory Integration

  • Shortcode: [cmloc-expert]
  • Use: Displays map with the CM Expert Directory records
  • Filtering parameters:
    • category - set expert category to display business on the map
  • View parameters:
    • theme - Choose between:
      • silver 
      • retro 
      • dark 
      • night 
      • aubergine
    • categoryfilter - show or hide category filter over the map
    • searchbar - show or hide the search bar ("1" to show, "0" to hide)
    • mapheight - the height of the map in pixels (decimal value without px string)
    • mapwidth - width of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)
  • Sample: [cmloc-expert category="56" categoryfilter=0 searchbar=0 mapwidth=600 mapheight=600 width=600 theme='silver']

More information about the CM Locations Manager WordPress  Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.