Greetings everyone,

Sorry I know it may sound trivial, but I need an "if statement" that does the following:

If (the current page is a BOOKpage or PAGE)
{
do stuff
}

I don't know the exact syntax for this. Your help is apprectiated :)

Comments

ShErbO’s picture

If you could point me to some drupal development tutorial or something.. it would be great. I feel embarrassed to ask such a silly question :$
The thing is, the development handbooks were quite hard for me, as my programming experience is very limited.

markhope’s picture

Depends what you are trying to do, but for general help...

Have a look under:
Customising the full page layout and sections based on node type
http://drupal.org/node/45944

It's in the section:
PHPTemplate Theme Snippets
http://drupal.org/node/45471

Here's an example:

if ($node->type == 'book') {/* check if it's a book page */ 
    include 'page-book.tpl.php'; /*load a page-book.tpl.php */
    return; }

Mark

mfer’s picture

if ($node->type == 'book' || $node->type == 'page') {
...
}

This is something you can use which is basic.