Category Archives: CMS

Drupal – Show a node location with Google Map in Views

We could add location information to node using the Location module. If the GMap module is enabled, we could even show the location with Google Map in Views.
1. Download and enable the GMap module.
 

2. Edit the Locative information of any content type. Make sure the Coordinate Chooser is set to Allow. Continue reading Drupal – Show a node location with Google Map in Views

Drupal – $data->field_name problem in Views Custom Field

We have talked about using Views Custom Field which really makes Views more versatile. In the custom PHP field, you can get the data of other fields from $data. But the field names under the $data may changed later as you modify the view.

A workaround is to get the field data from $data using the field_id. Continue reading Drupal – $data->field_name problem in Views Custom Field

Drupal – Get CCK Allowed Value Label

We can create a CCK selection list or checkboxes field with a list of allowed values in key|value pair. normally when you retrieve a node content, what you get is only the key instead of the value.

Suppose we have a content type called Silly Question(silly_question) with a field called Option(field_option) which has the following allowed values. Continue reading Drupal – Get CCK Allowed Value Label