Geospatial CMS


Displaying maps within other content

Once you have configured a map in Cartaro you surely want to display it in appropriately. You could use the Frontmap module if your site is very map-centric but integrating maps within other content is often preferable.

Setting up the map

Let's take a news article as example in which you want to have textual content accompanied by maps. Firstly, configure your map as shown in Getting Started with extensive detail. Note though, that the name of the map does not matter so calling it frontmap is not necessary.

Mind to enable all layers that you wish to display in the map configuration. You should check out the list of Behaviours offered there, too.

Enable maps in content

Drupal offers settings for various transformation steps for content that allow to prepare a suitable presentation. We'll use this mechanism to integrate maps in the article this way.

Navigate to Configuration → Content authoring → Text formats and opt to configure the format called Plain text.

Text formats

Tick OpenLayers Filters in the list of filters and drag the items in the processing order section around so that OpenLayers Filters comes last. This allows Drupal to enhance your content (adding links for example) and insert maps lastly so that other filters don't interfere with map rendering.

Enabling OpenLayers maps

Embedding maps

It's finally time to add content with maps or add maps to existing content. Navigate to Content, then Add content or edit.

Content with maps

Whenever you type [openlayers your_map_name] the text format just configured will take care to insert the map with the given name. Make sure to choose the correct text format from the drop-down below the text field. A hint about inserting maps will be display just below the drop-down as shown in the screenshot.

The visual appearance of the maps will depend on your map configuration, obviously. The first map in our example looks as shown below.

Embedded map with Cartaro

« Back to Documentation index