I have my module like this

function mymodule_menu() {
    $items = array();

    $items['mymodule'] = array(
        'title' => 'mymodule',
        'page arguments' => array('mymodule_form'),
        'access arguments' => array('access content')

    return $items;

function mymodule_form($form, &$form_state) {
    $form['text'] = array(
      '#markup' => 'mymodule content'
    return $form;

Which will create a page mysite.com/mymodule. I now want to add a meta tag to this page using drupal_set_html_head.

Anyone know where to place the drupal_set_html_head function call?

  • 1
    In your form function is fine – Clive Apr 24 '14 at 9:56
  • 2
    BTW You're missing 'page callback' => 'drupal_get_form' in your router item – Clive Apr 24 '14 at 10:06
  • @Clive yes it worked! Please make it as an Answer so that I can make it as the correct one! – Buntu Linux Apr 24 '14 at 10:09
  • @Clive, I have a plain text page. There fore I think I don't need a callback! But adding drupal_set_html_head to the form function worked! – Buntu Linux Apr 24 '14 at 10:11
  • Hey @Clive Why don't you copy the comment "In your form function is fine" to an answer so I can tick it as the correct answer and thereby you can get your reputation increased? – Buntu Linux Apr 24 '14 at 10:21

Your Answer

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

Browse other questions tagged or ask your own question.