For one particular project, it was really useful to include the Node ID in the block array. To do this, I included the following line of code (just after line 55): -

$block['nid'] = $node->nid;

Would it be possible to add this feature to future versions so the CCK block can reference the node the CCK is coming from?

Many thanks,

David

Comments

Anonymous’s picture

Could you please explain your project and the use of the node id in the block a bit more detailed?

Anonymous’s picture

Status: Active » Closed (won't fix)

All fields on one page belong to the node, that is currently displayed. That also applies to fields, displayed in blocks.

If you want to use the id of the current node, you can access it via:

          if (arg(0) == 'node' && is_numeric(arg(1))) {
            $nid = arg(1);
          }
dubs’s picture

That's great. Should have thought of that!!

Thanks for getting back to me.