Question

Iam very new to Drupal 7 so bear with me. I have created a jQueryUI drag and drop interface with JQueryUI tabs. My problem is i cant find the correct hook to add this custom interface to the admin interface. Like so (mockup) http://onlinemedia.rmcad.edu/sandBox/screenshot/screen-shot.jpg

All the examples I find are using CCK fields. CCK fields are great but they dont have this kind of custom functionality I want or does it?

Any help would very much be appreciated.

J

Was it helpful?

Solution

cck is drupal 6, not 7. to add to the node creation form you could use hook_form_alter or hook_form_ID_alter. Check the form api documentation to get an idea of how to add stuff to the form object in either of those hooks.

OTHER TIPS

From your mockup I understand you intend to add this drag&drop interface to a content-type.

If that's the case, I'd recommend you to add the appropriate fields first. Those would help storing the data in Drupal way, once the node is saved.

Once you are satisfied with the fields collecting the data you need, create a module and use hook_form_FORM_ID_alter hook to integrate your "interface", the presentation layer by altering those fields.

If you don't want to add CCK/Field components to store your data how about you create your own database table and store your custom data in there?

This approach is a long one but I have used it to great effect on a very big and complex project.

You will need a custom module with an install script which contains the details of your custom database table.

Forgive me but I don't remember the hook for altering a node-edit-form but that is where you input the code which implement your drag-'n'-drop elements.

Then, you could save the settings altogether when the node-edit form is submitted but I think it's probably better to implement some AJAX to save the settings to your custom database table. So, when a component is dropped into it's final resting place, you use AJAX to save that information to the database.

When a user comes back to edit that page, you simply load your custom settings and apply them to the drag-'n'-drop features and their previous configuration(s) would be visible to them.

I do hope that makes sense and it helps you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top