Adding CCK Fields Through Modules

Original Credit to Drewish from http://drewish.com/node/118, and of course the CCK team for such a fantastic tool. I'm just adding it here for reference, and expanding a bit with the uninstall knowledge.


Collapsible Form Item Descriptions

emfluence™ needed to start including fairly lengthy descriptions on some of their fields today, without taking all the screen real estate or bothering the users that already knew the system. The answer everyone agreed would be best would be to allow the form items to have collapsible descriptions. I traced out a way to do this by overriding the form_item theme provided by the basic form.inc from Drupal. This could be done through your template file, or a module by overriding the theme function (I explained this in another fragment a couple weeks ago) in case you're running multiple themes.

Drupal Content Type Module Skeleton

If you're a big fan of CCK, you've probably noticed that there are limitations eventually. It does fantastic work with data, but not so much with the nodes themselves. If you need things like access rights, redirection after XYZ, or custom permissions for business logic, you will like end up having to create your own content type through a module. Following is a very simple copy paste you can use to get started. It's got the most common hooks in there. Just copy and replace 'node_type' with whatever you wish yours to be.


Embedding a view with arguments

Assuming you're after putting a block in, pretty much anywhere you want, you'll need control over which url token you may be using at any point. Here's the code to read a url token, and embed a view based off it.



Subscribe to RSS - Drupal