I'm trying to embed custom content (custom javascript, paragraphs etc) with a Drupal Form. I'm wondering whats the best way to do it in module?

Something like this:

function wow_page() {
    drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline'); 
    $output = 'teasdasdst';
    $output = '<div id="test"></div>';
    $output .= drupal_get_form('wow_cake');
    return array('#markup' => $output);
  • 1
    I think you need to clarify your question. What exactly are you trying to do? Perhaps give an example of a use case? – Jukebox Feb 11 '13 at 23:12

ok add hook_menu that call this function

if you have module called wow

function wow_menu() {
  $items = array();
  $items['home'] = array(
    'title' => '',
    'page callback' => 'wow_page',
    'access callback' => TRUE,
  return $items;
| improve this answer | |
  • I already did that, it's all working but my question is really how to construct the page function so it can output multiple things easily. – user990717 Feb 11 '13 at 20:01
  • what do you mean output multiple things you display html that can be whatever u want or you can use hook_theme to make a new tpl page – Ahmed Feb 11 '13 at 20:06

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.