Interlude – Updated the Module Code

This entry is part 12 of 37 in the series NA Service Body Site with Drupal 7

After creating the features module and pushing the code, I tried cloning to another Drupal site and found some shortcomings in the process.

I neglected to include the Websites view, so I added that and recreated the feature.

The variables were not included with the Weblinks content type. To fix this, I installed the Strongarm module. Simply turning it on exposed all the necessary variables that I needed for the code. It was magical.

strongarm provided variables

I had a philosophical dilemma to deal with when it came to the Links Category vocabulary and associated Weblinks field. Since it is a required field the vocabulary has to be populated with terms prior to using the content type or it throws an error that cannot be resolved from the input form. The first option to fix this, and likewise make it much more flexible for the servant, is to change the field widget to an autocomplete type. This allows the content creator to input their own categories on the fly. The other option was to install another module that allows the export of terms and thus having some default terms available. I opted for the first choice. You will see this in the content creation video.

Autocomplete field

I have since recreated, committed and pushed the code, the Bitbucket repo now has my updates.

bitbut commits

All is better now.

Don’t know if I will document every change, but I will try to point the biggies as I go.

This entry was posted in Learning Web Technology. Bookmark the permalink.

Comments are closed.