Drupal 7 – Creating and Feeding Complex Content Types

It is no secret that one of the most important aspects of a website is its content – now more than ever. As websites become more complex, the information within often becomes increasingly complex to author and manage. While content management systems like Drupal have strong content authoring abilities out of the box, it’s easy to neglect this aspect of a site, thus creating an uphill struggle for administrative users that are less familiar with the system.

field collections is a simple, easy to implement module that we frequently use to enhance and streamline the content editing process. When the website enters in production another module like Field groups is very important to make authors update more confortable. At the end of this post, I will explain shortly the aim of that plugin.

Once the complex content modelling is complete we often need to migrate old data company or feeds with data the new drupal site

For all of that, you will need all the main modules below to install including the Entity and Ctools modules :

feeds

Once Feeds activated in Drupal this allow you to configure a Processor a Parser :

feeds-processor feeds-parser

Multiple related content fields using field collection

A fairly common problem we used to run into was the inability to add multiple sets of fields. That is, while a single field can be set to a specific value or unlimited, allowing you to add multiple entries into a field, historically there was no easy to allow you to add multiples of a group of fields.
An example would be if an editor needed to various quantities of actors or actresses to a play, along with the part they played. Field collections are created as entities within Drupal and  integrate well with the views module. Maintaining field collections is also very easy, it comes with it’s own administrative page available from the structure section. Adding a new field collection is as easy as adding any other field to a content type.
examplefc
An example of a field collection in action during content editing.

fc1

Another example of complex content types using Tags / Fields collections / text zones

complex_type

Sample configuration feed csv import into field collection:
How to feed a complex collection Field with csv import (unicode format):
Remember for double quotes you must replace them : every ” with “”” in order to make feed import working.

 

fielscollection1

fielscollection2

fielscollection3

fielscollection4

drp-datas

Feeds Tamper is very important to manage multivalued field import, it works with feeds import module :
A sample of confiuration csv table like this format : isn;value1|value2|value3. You must add a plugin with tamper on second zone that explode values around | ….

tamper-plugins

tamper

Sample Mapping feed import for a zone Tag or Term reference type in Drupal :

geogeo-tamper

A visual basic program on Access 2010 for preparing files for multivalued fields import in drupal …

vb-tamper

XML Feeds works with xml files nodes , it works with feeds import module :
A sample of confiuration for this format importer :

xml-feed1

xml-feed2

Improving the out-of-the-box editing experience

The drupal plugin Field groups is used to group fields together in a variety of ways during the editing process. By default, Drupal simply spits out any and all fields onto the content editing page in the order specified within the content type.

groupfields

Example of using field groups to group content fields together.

As you can see – this makes for a much easier editing experience for the user. Related fields are grouped together using vertical tabs so the editor can simply click through each section quickly without having to scroll through a long list of fields.
Cheers

extradrmtech

Since 20 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions. I am an experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. When not writing code, I like to dance salsa and swing and have fun with my little family.

You may also like...