Drupal 6.22, Panels 3.

I have a Mini Panel which is a block appearing on all pages of the site.

I would like the node id of a page, if available, to be shown in the title of the Mini Panel.

My first guess is to do this with Contexts for the Mini Panel, but I am confused by "Required Context" vs "Context", etc. When creating contexts of both types, I do see the substitutions keywords in the Mini Panel content area.

Is there an issue with passing arguments into a block?

Is there a PHP snippet that can work?

Comments

ayesh’s picture

if ( arg(0) == 'node' && is_numeric(arg(1)) && ! arg(2) ) {
  $node = node_load(arg(1));
  print $node->nid;
}

This will print(or if you need, echo) NID of current node. But I don't know if title field accept php code.

Cablestein’s picture

Thanks, that will be useful for some things.

I was kind of hoping for a Panels Context solution, so I could eventually pass arguments to Views somehow =).

Could I pass $node to a View (in the block) as an argument perhaps?

ayesh’s picture

No need to use Panels to do that.
Why don't you set the View's arguments to get node ID from current node ?(Provide default argument > Node ID from URL)