Create a Database Table for Custom Module in Drupal 7

Creating a database table for Drupal module is straight forward and one of the easiest task in Drupal. To create a table, what all you need is to create a .install file inside module directory and implement hook_schema(). Inside hook_schema() implementation, specify the structure of table in array form.

Style Single Field Specific to a Content Type in Drupal 8

This article will guide you to change the style of a single field in a specific content type. Here I am going guide how to style 'Tags' field of 'article' content type. Standard Drupal 8 distribution comes with 'Article' content type, and it is having 'Tags' field. So, you can try out this on a standard Drupal 8 installation.

Right Method to Get the Language Code for a Given Drupal 7 Entity

While programming for Drupal, it is a very common scenario to get the language code for a given entity. A bad practice being followed by many programmers is hard-coding the value und directly as language code. Some programmers will take languag property of the entity object, this only works for entity of type node and entities that have property named language as entity key for language.

subscribe via RSS