How to add Meta and Title tags to the document head on hook_menu "page callback"? Drupal 7

closed as unclear what you're asking by Krishna Mohan, Mołot, AjitS, Bala, Adam Balsam Dec 22 '14 at 22:27

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Why do you think adding meta tags have anything to do with menu hooks? – Mołot Nov 21 '14 at 7:47

Assuming Drupal 7...

For the title you can use drupal_set_title().

For the meta tags you can use drupal_add_html_head(). Example from geerlingguy in the comments of those docs:

$element = array(
  '#tag' => 'link', // The #tag is the html tag - <link />
  '#attributes' => array( // Set up an array of attributes inside the tag
    'href' => 'http://fonts.googleapis.com/css?family=Cardo&subset=latin', 
    'rel' => 'stylesheet',
    'type' => 'text/css',
drupal_add_html_head($element, 'google_font_cardo');

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