Thêm Google Maps vào trong Drupal Content

Thêm Google Maps vào trong Drupal Content

Our Drupal students frequently want to add a map to their content. In this tutorial we're going to show you how.

We'll take the example of a Yellow Pages-style directory and show you how to display a Google Map beside each business listing.Thêm Google Maps vào trong Drupal Content

Install

Install and enable these two modules:

If you don't have it, you will also need CTools:

Create a Content Type Using Address FIeld

The first step is create content using the Address Field module.

  • Go to Structure > Content types.
  • Create a new content type called Companies
  • Add a field using the Postal Address field.

tutuploadsmedia_1349207999285.png

Add Content

Click Add content and add a company to your site. We used Phase2 as an example, because they actually built these address modules:

tutuploadsmedia_1349208196356.png

Configure the Address FIeld Static Map Block

  • Go to Configuration > Address Field Static Map Block
  • Configure the Address Field option to use the field that you just created.

tutuploadsmedia_1349208476556.png

  • Configure the Image Size option to fit the area of the site that you'll place this map into.

tutuploadsmedia_1349208528039.png

Place the Block

  • Go to Structure > Blocks.
  • Publish the Address Field Static Map block.

No matter which pages you try to place this block on to, it will only appear under two conditions:

  • If the full content for a node is showing.
  • If the full content contains a field_address entry.

Here's how Phase 2 appears:

tutuploadsmedia_1349208620830.png

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Bỏ qua Search API đi Reindex a Node / an Entity Drupal 7

Bỏ qua Search API đi Reindex a Node / an Entity Drupal 7

By default Search API (Drupal 7) reindexes a node when the node gets updated.

Quảng Bá Website trong kinh doanh(Business SEO)

Quảng Bá Website trong kinh doanh(Business SEO)

Quang Ba Website - Gần như 99% các yêu cầu dịch vụ SEO mà chúng tôi nhận được đều bắt đầu bằng câu hỏi “tôi muốn các từ khóa x, y, z lên top 5 Google, giá bao nhiêu và thời gian bao lâu?

Creating Printer-friendly Versions of Drupal Articles

Tạo Printer-friendly trong Drupal Articles

In this tutorial we'll show you how to add a "Print This Page" button to Drupal. The main reason you'd want to do this is as a courtesy for your readers. Many still print things they read online and you don't want them to waste that expensive printer ink just to print your logo and theme as well as the article.

Công ty diệt chuột T&C

 

Diet con trung