I am building a restaurant application which would have a search functionality, and when somebody searches of restaurants for a zip code, it would return the data. The data would be the name of the restaurant, the description and the map. When a user is adding the restaurant, I am using address field and geofield to get the latitude and longitude, so getting the maps up and running isn't an issue now.

However, I trying to create the search view, but I am unable to create a view which has a path, and which would display the title, description and then the map.

ex: Title | Description
    MAP1(map for first restaurant)

    Title | Description

Can somebody tell me how would I build it?

The modules I am using to build this are geofield, geophp, geocoder, addressfield, openlayers, views, ctools and libraries.


You can add the map into a view in simple way. Enable the "geofield map" module .Create a view . you can add a field(geofield) and in the settings you can give the "Formatter" as geofield map. You can also add the other fields you needed from that node.

enter image description here

Step 1 :Enable the "geofield map" module in the geofield module pack. Than create a view with the geofield (latitude and longitude) fields with a contextual filter node id. In the view you can set the "Format" as geofield map(see attachment). . You can also do with the help of "location" module. Now you have a view of map.

enter image description here

Step 2: Enable the views_field_view module. Create another view for the restaurant details. For viewing the map, you can select "Global :view" in the field. There you can select which view you should have to embed in that field and you can give the arguments there(here 'nid') in the field settings(see attachment).

enter image description here

See also the Views Field View module, which may help you.
You can first create a view for the map with a argument as node->nid. Then create another view for your restaurant. In the second view you can embed the first view (for map) as a field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.