World Map Album Part 2 - Configuring pop-up box
Primary tabs
world map albm part 2 by kiwipion
Introduction
This tutorial is a follow-on from the world map tutorial where we ended up with a popup box displaying the node gallery title. Now that existing implementation was a little too bland for me and I have been causally looking around for a way not only to style the popup box but to configure the contents of the box.
Recently I saw a post where you could now set the output of the popup box as a View Mode, bingo! On initial investigation I found out I had run out of View Modes and was reluctant to pinch any from the node gallery. Here's where entity view modes step in, they are an easy method of creating extra View Modes.
So the intention of the tutorial is to convert what we had completed in the end of the world map tutorial from this
to this

the major changes being about to replace the description field with the content' view mode and adding a style to replace the orange dots with a camera symbol.
Method
We are going to create a new view mode for the node gallery using the entity view modes, then we will clone the node gallery view to set up a output of of up to four small sized thumbnails.
Module Skill Acquisition
-
Openlayers
- Styling
- Geofield
-
Views
- View Cloning
- Views Relationships
- View Modes
- Image Styles
Prerequisite
Do the node gallery & world map tutorial part 1 first,
Install the entity view mode module.
Steps
- Create a small thumbnail style, I'll be using the scale & crop effect so all the thumbnails are of the same dimensions.
- Add a new view mode in the node section via the entity view module. This can be found in the system section of the configuration page.
-
Clone the node gallery view and in the Node Gallery Display (or whatever you called it.)
-
Edit the image field and
- Change the formatter to image
- The image style to the one we just created, in my case the world_map_thumbnail image style
- link the image to nothing for we will rewrite the output to the Node Gallery itself instead of the Node Image later on in this tutorial.
- Also nows a good time to remove the pager and just fix the number of items to be displayed, I'll keep my the same to four.
-
Add another display, which will be a "Entity content'
-
In the "ENTITY CONTENT SETTINGS'
- Select the Entity type: to Content
- Bundles: to Node Gallery
- In the "Filter Criteria" change the content type to Node Gallery
- The "Format" to grid, I'll keep the default columns to 4.
- Also in "Format" change the fields to content and select the View Mode to the one we created from entity view modes, in my case the world map popup.
-
In the "ENTITY CONTENT SETTINGS'
-
Edit the image field and
- Go to the view that has openlayer configuration and go to the "OpenLayers Data Overlay details" display
-
-
Open up the format settings
- Set the "description content" as <entire node>
- And the "view mode" to the view mode we created from entity view mode in my case <world map popup>
- We can also removed the title because it is already include with node's content type.
-
Open up the format settings
-
Go to the Node Gallery's manage display settings
- Enable the new view mode from the "Custom Display Settngs".
- Ensure that the correct views fields are visible, note you should also check the Teaser & Full Content view modes in case the new views fields have been added to those.
Go to the worldmap and check the behavior of the popup box. Note that the thumbnail links have been disabled for their output would have gone to the image instead of the node gallery. We can redirect the link using the relationship between the node gallery & node image that is provided via the node image's node refererence url. Examples of this technique are shown in the mutiple albums & node gallery pager tutorials.
-
Go to the world map node gallery view, and select the node gallery display
- Add a relationship by selecting the node reference url that belongs to the node image
-
Add a content:nid field
- Select the relationship that was just created
- Select exclude from display
- Rearrange the fields so the content:nid is above the image field.
-
Go into the image field
-
Select "REWRITE RESULTS
- Enable "Output this field as link
- Get the Content:nid token value from "REPLACEMENT PATTERNS" and paste it into the link path as such
-
Select "REWRITE RESULTS

Now for a final bit of eye candy, let's change those yellow dots by adding a new openlayer style.
- Go to the openlayers styles list and click add. The remainder should be self explanatory. Note in the style properties I tend to use relative drupal paths and will be setting the size 25px by 25 px,
- If everything has gone to plan your popup boxes should look something like this

Wrap-up
This now concludes this two part world album node gallery tutorial series. As well as gaining useful exposure to Openlayers and Geofield drupal modules, the viewer will have gained knowledge in views 3.0, views relationships, image styles, node references, cloning views, view modes to think of a few.
That's all for this one folks and remember don't forget to flush your cache.
Latest Updates
Recent comments
Recent Tweets
- New post: Posting location co-ordinates to a drupal service - Part 2 http://t.co/MQhlVKBNKC — 1 month 1 week ago
- New post: Posting location co-ordinates to a drupal service - Part 1 http://t.co/2xlYgqFaJ0 — 1 month 1 week ago
- New post: Connecting a drupal service with a mobile application - Part 2 http://t.co/01cFtAunDs — 1 month 1 week ago
- New post: Using drupal services to connect to mobile applications - Part 1 http://t.co/VEURftHCef — 1 month 1 week ago
- New post: Creating Drupal 7 video gallery http://t.co/HvpKU7uT — 3 months 1 week ago









Comments
description content vs description field
I am following the steps for your tutorial for world map album part 2
I have installed all the new releases for the modules for this exercise.
when you go to Worldmap Album view
and go to the "OpenLayers Data Overlay details" display
* Open up the format settings
o Set the "description content" as <entire node>
I don't get the above option. Instead, I have in the "description field" <entire row>
so the view mode never pops up.
What steps did I miss? Would you please let me know?
Thanks,
Ayonara
Check you are using the latest dev version and not beta 1.
Hi Ayonara
I managed to reproduce your problem by running update via drush which loaded the beta 1 version of Openlayers. Now Beta 1 is dated Nov 27 2011, and this change supporting view modes is a recent one. I then changed to the dev version of Openlayers, which at time of writing was about a day old and the description content and view mode were restored.
Hopefully this is the issue you are seeing.
Nigel
i have a fairly recent instal
i have a fairly recent install of drupal7, updated today, and installed entity view mode module today. i'm not seeing "Entity Content" when i try to create a new view in views - what am i missing - another module?
Check that the eva module is installed
This tutorial is a follow on the worldmap tutorial, which is a follow on from the node gallery tutorial. I recommend following those tutorials first which will get your enironment setup properly for this one including the installation of the eva module. Note from the comment description I'm guessing the issue is that EVA is not installed. Also check you have the dev version of Openlayers installed.
oops, i missed that about EVA
oops, i missed that about EVA.
How is it best to install the dev version of OpenLayers. Do i uninstall the "std" module, and then install the dev module (i'm using the browser Admin tools, not the command line) or are them some other steps in such cases?
My website is working fine with std OpenLayers up to now, what advantage does the dev version bring?
Thanks for your tutorials and the very quick response to my original question.
Safest way would be to uninstall the old module first
that way you won't have any old files left that may affect the dev module. At this moment in time I mention using the dev version of Openlayers because it provides the view mode support in Views, which has not yet been integrated into the approved release.
Missing "Node" section of Entity View Modes Configuration
Hi Nigel -
For this tutorial my EVM Configuration page lists only the sections: COMMENT, CONTENT, TAXONOMY TERM, and USER. I'm running the "beta 1" version of OpenLayers and have installed the Eva module. Any suggestions you have that would provide access to the NODES section of the EVM configuration are greatly appreciated.
Thank you very much for this great site. Your tutorials are thorough and user friendly.
All the best - Ken
Select Content instead.
Hi Ken, It looks like they have made a slight change to the EVA module and renamed node to content, which is more correct for Drupal 7. Content types used to be called nodes prior to Drupal 7.
Thanks for your reply.
Hi Nigel -
Thanks for getting back to me - awesome of you to do so. I'm working with the Content section and it looks like a winner.
Thanks so much for taking time to put together these tutorials and for going the extra mile to respond to inquiries.
All the best,
Ken
Hampton, Virginia
Clusters with numbering
I need to create cluster on map to make it less messy. any help ?
This link may help ...
In the Openlayers issues list there is a patch here , that may help you out.
great stuff
Hey Nigel (sp?)
Great tutorial - appreciate al the time you've put in to it - great screen cap program too
Question - would it be possible to link the thumbnail to the theatre view of the image instead of the gallery?
Need to think about this one.
Hi Mox, Before I respond with a no or don't know, I want to try some things out, because its a valid use case. If I spot a solution I'll post it as a response to this thread.
Regarding Clustering
I need to gather all the content types into one cluster to make map more clean. Any idea ?
I have not yet looked into clustering ...
If I spot a usuable soltution I'll post a response or draft a tutorial.
More fields in tooltip/popup
Thanks Nigel for the pair of tutorials on this.
In case anyone wants more than one field of data in the tooltip aka popup, here is your solution: http://drupal.org/node/1401940#comment-6122010
Pages
Add new comment