0

Is it at all possible to check for a page template NID before outputting some text in a custom node template file?

I have a custom node template file and I am using that data in a custom page template file. I have checked in the past the NID of a node using the following that that works:

          if (($node->nid) == '25732') { 
            print views_embed_view('lead_view',"page"); 
          }

Now I want to check whether the page template file is 1234. I tried using $page, but I don't think that is right.

          if (($page->nid) == '1234') { 
            **Stuff here** 
          }
0

you can do this like

if(arg(0) == 'node' && arg(1) == '1234'){
**Stuff here** 
}

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.