I updated the code to provide content type and cck field information for custom modules to work with Drupal 6.
This is the method I’m using to run the import. This method resides in a site_profile module I use for common functions for restoring sites via installation profiles for deployment.
It works using exported ‘macros’ from the content_copy module data export form. The cck content_copy handles all the content type and field importing. If the types or fields already exist, they are not duplicated and are handled gracefully. Feedback is provided as fields and types are added.
I usually add a folder called ‘cck’ to my module folder and copy and paste the content_copy export data structure into separate files, like this
- …/modules/my_module
- …/modules/my_module/cck
- …/modules/my_module/cck/my_content_type.inc
- …/modules/my_module/cck/my_other_content_type.inc
I simply copy and paste the exported data from admin > content types > export into the .inc files.(…)
I recently needed to programmatically create CCK fields for a custom module.
I wanted to be able to install my module and automatically create it’s required CCK fields.
I ended up using the following code function:(…)
Click to continue reading “Programmatically create CCK fields”
Recently I found myself wanting to add and remove stylesheets via template.php
I thought there must be a way to do it via the _phptemplate_variables function.
Sure enough, there is:(…)
Click to continue reading “How to add and remove stylesheets in template.php”
This is a blog to record tidbits of information. It documents thoughts and ideas that may be useful for other people, like yourself.