2013-12-14



In Drupal 7 you can push extra fields in any fieldable Entity (e.g. node, user). Extra fields can be ordered as a normal field or disabled on the display settings page of the enitity. They are great when you want to push content in your entity, that need some logic to be displayed.

Start by creating your own Drupal 7 module. That is beyond the scope of this blog post, you can find a good reference on the Drupal site.

Now you are ready to use two hooks. The first one defines the extra field you want to add.

In this example I've added the pseudo field 'my_field' to the entity node on the bundles 'page' and 'article'. Note: Replace HOOK in the function name with your own module name!

The next hook will add the content.

Put in your own logic and enjoy!

Show more