By NotSoAwesome on
Hello,
For a school project I'm trying to create a drupal module that helps students to plan their studying.
I understand I need Date API and probably Calendar to het my module functional but I don't really understand how to use them (Date & Calendar) in the module.
To be more clear: I want to know how to use hooks of another module in the code of my module. This is a coding question.
Could someone point me in the right direction?
This is my first attempt at creating a module and I'm not native English.
Thanks in advance.
Comments
For the things you want to
For the things you want to achieve you probably don't need to use hooks at all.
Download both modules and extract the compressed files in the folder sites/all/modules or better make a folder contrib inside sites/all/modules and extract both modules there.
Now go to your site (logged in as the admin user you created) and go to admin/modules.
Here you can enable the modules you just placed there.
Finally both modules have admin pages where you can set them up further.
The best way to get started is reading documentation
Since you edited your question, my previous answer is not relevant any more.
First you should look in the documentation of both modules on http://drupal.org/
What you should do next is look for hooks to the Date & Calendar module that suffice with what you want.
Also you could look for more general Drupal hooks, which are documented very nicely here: http://api.drupal.org/
I've read all the
I've read all the documentation about it.
The problem is, nowhere does it mention clearly how to use hooks in the code of my module.
That's really what I'm looking for, an explanation how to use the hooks of another module in the code of my module.
Basically all you need to do
Basically all you need to do is replace the word hook with your module name.
So for using hook_menu in the module named not_so_awesome you call the function not_so_awesome_menu.
All this is explained clearly here http://api.drupal.org/api/drupal/includes!module.inc/group/hooks/7
Hooks of a contrib module can be found in its .api.php files.
So if I use the same name, it
So if I use the same name, it has the same functionality as the hook in the api file?
Not exactly. Each hook allows
Not exactly. Each hook allows you to do something. If you implement that hook, you can do that.
For example, hook_form_alter() allows you to alter forms. If you implement this hook, you can alter forms inside it. You have to write the code to do that though.
Contact me to contract me for D7 -> D10/11 migrations.