CM Map Locations (CMML) - Using Shortcodes

Shortcodes

Shortcodes allow you to add a map with your locations to posts and pages. There are different shortcodes depending on what you want to display.

For reference, these shortcodes are displayed on the Settings page under the Plugin tab.

Snippet

This displays a location's snippet. By using the shortcode [cmloc-snippet id="487" featured="map"], we are able to add a snippet of this location to the blog post.

You can edit what is shown on the snippet under the Settings tab. See related article on editing settings.

  • Shortcode: [cmloc-snippet id=location_id featured=image|map]
  • Attributes:
    • id - set location ID to display specific location map.
    • featured - set map to display interactive map or image for static image.

A Specific Location Map

Use this shortcode to display a specific map using the ID found in the URL while editing the location. For example, using the shortcode [cmloc-location-map id="487" graph="1" params="1" mapwidth=pixels mapheight=pixels width=pixels],we are able to display a map of the location in a post.

A Specific Category with Locations

  • Shortcode: [cmloc-location-map id=location_id category=slug|id mapwidth=pixels mapheight=pixels width=pixels]
  • Attributes:
    • id - location ID,
    • category - set category ID/slug to displays locations from this category.
    • mapwidth - width of the map in pixels (decimal value without px string)
    • mapheight - height of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)

This displays maps with locations from a chosen category. For example, using the shortcode [cmloc-locations-map category="mountains"], we are able to display a map with the locations from one category in a blog post.

All Locations Map

  • Shortcode: [cmloc-locations-map list="one of: none left right bottom compact" limit=5 page=1 category="id or slug" mapwidth=pixels mapheight=pixels width=pixels]
  • Attributes:
    • list - set position of locations list (none|left|right|bottom|compact),
    • limit - set locations limit,
    • page - pagination page to display,
    • category - write category slug or ID to display locations on the map,
    • mapwidth - width of the map in pixels (decimal value without px string)
    • mapheight - height of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)

My locations table

This shortcode display the user's location table, the same that is showing up in the user's dashboard.

Shortcode: [my-location-table]

Attributes:

  • 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.

Common Map with Routes Integration

This shortcode displays a common map with locations and routes from the CM Map Routes Manager plugin.

  • Shortcode: [cmmrm-cmloc-common-map path=0 categoryfilter=0 mapwidth=pixels mapheight=pixels width=pixels]
  • Attributes:
    • path - set "1" if you want to display path or "0" if not.
    • categoryfilter - Show/Hide category filter above the map.
    • mapwidth - width of the map in pixels (decimal value without px string)
    • mapheight - height of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)

Business Directory Integration

Displays map with the CM Business Directory records.

  • Shortcode: [cmloc-business category=id|slug categoryfilter=0 mapwidth=pixels mapheight=pixels width=pixels]
  • Attributes:
    • category - set business category to display business on the map,
    • categoryfilter - show or hide category filter over the map,
    • mapwidth - width of the map in pixels (decimal value without px string)
    • mapheight - height of the map in pixels (decimal value without px string)
    • width - width of the entire widget in pixels (decimal value without px string)

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