Variables available on display suite php field I'm using Display Suite module to create custom fields.

I've to add a code field (php), that calls a function that has $nid as argument. I've added this field to node entity but I can't understand if there are variables available on this field.

Adding a php field I've a textare where I can add php code.ù
I've a custom functions that retuns html and require a nid as argument.

so in my custom field I should have something like:

&lt;?php
print my_function($nid);
?&gt;


The problem is that I don't know where find the $nid: $object? $node? $entity? $context?

This field is added on an node entity.
You can get access to the node via the $entity variable within the "Field code" text area.

This will only work for the Display Suite "Code Field". If you are using Display Suite 7.x-2.x, you'll have to enable the "Display Suite Format" module.

If anything is setup properly, you should see this help text below the "Field code" text area:


  You may post Display Suite code. You should include  tags when
  using PHP. The $entity object is available.