3

Is it possible to use a Page ID to target a specific page i.e.

function module_pageid_page_alter(&page){
}
7

By page ID I guess you mean the page path? There isn't a hook like the one you've suggested but you can do basically the same thing in a standard hook_page_alter() like so:

function MYMODULE_page_alter(&$page) {
  if ($_GET['q'] == 'node/1') {
    // Do something for node 1
  }
  else if ($_GET['q'] == 'admin') {
    // Do something for the root admin page
  }
}

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.