Salesforce Integration mit Drupal 7

Eine Fallstudie über die Integration von Salesforce in das System von viennaresidence business rental apartments im Rahmen des Drupal Business Days Vienna 2011:

Inhalt einer field_collection laden

Das Modul field collection ermöglicht es, in einem Formular ein Feld zu definieren, das wiederum aus mehreren Feldern besteht. Ideal um eine Art "Kombofeld" zu erstellen, aber vielleicht ein anderesmal darüber mehr.

Will man nun (zum Beispiel für eine spezielle Anzeige der Daten in einem Template) die Inhalte so einer fieldcollection laden kann man entity_metadata_wrapper() verwenden:

Loading field_collection values in templates

Field collection is a great module to have some sort of a bundle of fields in a form. Thus you can build a form field with mulitple values that itself has more than one fields attached. Maybe more about this module in another blogpost.

If you want to load the values of a field collection entity (just if you need it in an template for example) you can use entity_metadata_wrapper():

Drupal theming: Get field values in Drupal 7

Drupal 7 has another array structure for storing field values in $node. There is a new array key for the language.
For example:


This can be quite useful but makes it difficult to access the right data.
So here is a handy solution:

$items = field_get_items('node', $node, 'field_yourfield', $node->language);

You can leave the $node->language argument empty. If done the current language will be called automatically:

State of Drupal - Drupalcon London Keynote by Dries Buytaert and more

Drupalcon Keynote Audience
During Drupalcon's first keynote Dries Buytaert presented the current state of Drupal. Here are some of it's most interesting facts:

  • Drupal's grow seems to continue, especially in the field of large media organizations (Sony, Universal, NBC), but also in education (39% of all .edu websites run Drupal) and technology (Twitter, Cern, Intel, Symantec).
  • Another interesting fact is that Drupal is growing faster in Europe than in North America.
  • Dries thinks we failed to communicate the benefits of Drupal 7 well enough.

Drupal 7 Theming and the image Path

In Drupal 7 there is a filefield in core now, there is also something like imagecache in Drupal 6 called image styles.

When it comes to theming you will soon find out that the image data stored in the node array is completely different than before. For example there is no filepath available.

Display image fields in templates

First and recommended solution would be to display the field as it is with the render() function:

Subscribe to RSS - drupal7

Powered by Drupal7