Loading modules/facets_summary/src/Plugin/Block/FacetsSummaryBlock.php +12 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,11 @@ class FacetsSummaryBlock extends BlockBase implements FacetsSummaryBlockInterfac * {@inheritdoc} */ public function build() { // Do not build the facet summary if the block is being previewed. if ($this->getContextValue('in_preview')) { return []; } /** @var \Drupal\facets_summary\FacetsSummaryInterface $summary */ $facets_summary = $this->getEntity(); Loading Loading @@ -124,4 +129,11 @@ class FacetsSummaryBlock extends BlockBase implements FacetsSummaryBlockInterfac return []; } /** * {@inheritdoc} */ public function getPreviewFallbackString() { return $this->t('Placeholder for the "@facet_summary" facet summary', ['@facet_summary' => $this->getDerivativeId()]); } } modules/facets_summary/src/Plugin/Block/FacetsSummaryBlockDeriver.php +4 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\facets_summary\Plugin\Block; use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Plugin\PluginBase; Loading Loading @@ -63,6 +64,9 @@ class FacetsSummaryBlockDeriver implements ContainerDeriverInterface { 'label' => $this->t('Facet Summary: :facet_summary', [':facet_summary' => $facets_summary->getName()]), 'admin_label' => $facets_summary->getName(), 'description' => $this->t('Facets Summary'), 'context_definitions' => [ 'in_preview' => new ContextDefinition('string', $this->t('In preview'), FALSE), ], ] + $base_plugin_definition; } $this->derivatives[$base_plugin_id] = $plugin_derivatives; Loading Loading
modules/facets_summary/src/Plugin/Block/FacetsSummaryBlock.php +12 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,11 @@ class FacetsSummaryBlock extends BlockBase implements FacetsSummaryBlockInterfac * {@inheritdoc} */ public function build() { // Do not build the facet summary if the block is being previewed. if ($this->getContextValue('in_preview')) { return []; } /** @var \Drupal\facets_summary\FacetsSummaryInterface $summary */ $facets_summary = $this->getEntity(); Loading Loading @@ -124,4 +129,11 @@ class FacetsSummaryBlock extends BlockBase implements FacetsSummaryBlockInterfac return []; } /** * {@inheritdoc} */ public function getPreviewFallbackString() { return $this->t('Placeholder for the "@facet_summary" facet summary', ['@facet_summary' => $this->getDerivativeId()]); } }
modules/facets_summary/src/Plugin/Block/FacetsSummaryBlockDeriver.php +4 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\facets_summary\Plugin\Block; use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Plugin\PluginBase; Loading Loading @@ -63,6 +64,9 @@ class FacetsSummaryBlockDeriver implements ContainerDeriverInterface { 'label' => $this->t('Facet Summary: :facet_summary', [':facet_summary' => $facets_summary->getName()]), 'admin_label' => $facets_summary->getName(), 'description' => $this->t('Facets Summary'), 'context_definitions' => [ 'in_preview' => new ContextDefinition('string', $this->t('In preview'), FALSE), ], ] + $base_plugin_definition; } $this->derivatives[$base_plugin_id] = $plugin_derivatives; Loading