You are here

function PanelizerEntityBean::entity_base_url in Bean (for Drupal 7) 7

Provides the base panelizer URL for a bean entity.

We override the parent function in order to use the delta rather than raw bean id.

File

plugins/entity/PanelizerEntityBean.class.php, line 112
Class for the Panelizer bean entity plugin.

Class

PanelizerEntityBean
Panelizer Entity bean plugin class.

Code

function entity_base_url($entity, $view_mode = NULL) {
  $bits = explode('/', $this->plugin['entity path']);
  foreach ($bits as $count => $bit) {
    if (strpos($bit, '%') === 0) {
      $bits[$count] = $entity->delta;
    }
  }
  $bits[] = 'panelizer';
  if ($view_mode) {
    $bits[] = $view_mode;
  }
  $base_url = implode('/', $bits);
  return $base_url;
}