Creating a custom content type manually


show more Creating a custom content type manually provides you with in-depth training on Developer. Taught by Jon Peck as part of the Drupal 7 Custom Module Development show less
please wait ...

Creating a custom content type manually

Previously, I demonstrated how to add persistent variables to module, then how to remove them cleanly using hook install and hook uninstall. When creating and destroying a content type the same hooks are used, which is logical. Open the IDE and navigate the windfarms. install file and navigate to hook_install following the message to the user. I'm going to define the content type itself using an associative array. Start with the variable definition named content type, Content type definition, content_type = array. The order of the keys is unimportant, but I'll use a logical progression.

First, the type of content. This is a machine name. All lower case with spaces instead of underscores. In this case, I will use windfarm as the name of the content type. Next, a human readable name for the content type. I will use the T variable for the Translation function, since hook installed for a module can be called during site installation. Name is Wind Farm, following the name a ...

Creating a custom content type manually
Video duration: 3m 44s 2h 56m Advanced

Viewers:

Creating a custom content type manually provides you with in-depth training on Developer. Taught by Jon Peck as part of the Drupal 7 Custom Module Development

Subjects:
Developer Web
Software:
Drupal
Author:
please wait ...