function ViewsBlockBase::getPreviewFallbackString

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/Block/ViewsBlockBase.php \Drupal\views\Plugin\Block\ViewsBlockBase::getPreviewFallbackString()
  2. 8.9.x core/modules/views/src/Plugin/Block/ViewsBlockBase.php \Drupal\views\Plugin\Block\ViewsBlockBase::getPreviewFallbackString()
  3. 11.x core/modules/views/src/Plugin/Block/ViewsBlockBase.php \Drupal\views\Plugin\Block\ViewsBlockBase::getPreviewFallbackString()

Overrides BlockPluginTrait::getPreviewFallbackString

File

core/modules/views/src/Plugin/Block/ViewsBlockBase.php, line 112

Class

ViewsBlockBase
Base class for Views block plugins.

Namespace

Drupal\views\Plugin\Block

Code

public function getPreviewFallbackString() {
  if (!empty($this->pluginDefinition["admin_label"])) {
    return $this->t('"@view" views block', [
      '@view' => $this->pluginDefinition["admin_label"],
    ]);
  }
  else {
    return $this->t('"@view" views block', [
      '@view' => $this->view->storage
        ->label() . '::' . $this->displayID,
    ]);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.