Hi,

I have a content type "News Page". I added few contents (node/1,node/2, node/3).
I also have a basic page (node/20).

I created a block I like to display to all the nodes of the content type plus basic page.

In block config page > Only the listed pages > I entered

node/20
News Page/*

Now, I only see the block in node/20. I do not see the block in other nodes of the content type.

I can easily display the block only in the content type by selecting the content type checkbox under Show block for specific content types.

Problem starts when i want to display in content type and a separate node. Please advise.

Comments

yelvington’s picture

You can use PHP block visibility settings.

Something like:


$nodeType = "New Page";

// valid node id in view mode
if ( arg(0) == 'node' AND is_numeric(arg(1)) AND arg(2) == FALSE ) {
    $node = node_load(arg(1)); // cached
    if ( ($node->type == $nodeType) OR ($node->nid == 20) ) {
        return TRUE;
    }
}
return FALSE;