I have created a custom content pane in a panelized node and I am trying to access $entities for that node. When using display suite code as the editor I see that the $entity object is available yet it never renders.

I'm trying to do something like this:

  if (!empty($entity->field_image['und'][0]['filename'])) {
Do something 
} 

Even if I just try to print out the $entity it doesn't render. Can anyone say why I can't access these values like this?

Comments

museumboy’s picture

Issue summary: View changes
damienmckenna’s picture

Status: Active » Fixed

You might try using the Devel module and the dpm() function to see what is actually available at that point, e.g. dpm(get_defined_vars()); will display a list of all values available, dpm($entity); will output the entity at that point in the execution process.

That said, I strongly recommend against using the PHP module, you should instead create a custom "content type" plugin following one of the guides available online, e.g.:

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.