I have a very complex page (Multiple Ajax calls and access to other three other mysql databases) that i would like to create within Drupal or find a way to embed it into Drupal. Now I do not want Drupal to manage the page, i would only like to just pull the header, navigation and footer from Drupal and manage the "content" with my own code manually. In Wordpress this is very easy to do but in Drupal it does not seem to be straightforward. What is the best way to accomplish this in Drupal.

can custom modules handle that? can views handle that? what are my best options?

Note that i just want to know if it is possible and how do i embed my own code into Drupal without having Drupal manage the code.


Yes, you'll generally solve this by writing a custom module. In your .module file you'll probably want, as a minimum:

  1. An implementation of hook_permission to provide access control to your content
  2. An implementation of hook_menu to define the routing to your page, in other words which URLs will cause your custom code to be invoked.
  3. The actual callback which generates the content.

In the callback you can use whatever PHP code you want, though if you do use Drupal's APIs and established good practice you'll be less likely to create security weaknesses and your code will work better with other modules. That's likely to save you time in the long run.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.