Skip to content
Snippets Groups Projects
Commit 663c3712 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1984582 by jibran, kattekrab, dawehner, larowlan: Add views support for custom blocks

parent 436071f3
No related branches found
No related tags found
No related merge requests found
Showing
with 1445 additions and 0 deletions
# Schema for the views plugins of the Block Content module.
# @todo Fix this when https://www.drupal.org/node/2322949 is fixed.
views.field.block_content:
type: views_field
label: 'Block Content'
mapping:
link_to_entity:
type: boolean
label: 'Link this field to the original piece of block content'
views.field.block_content_type:
type: views.field.block_content
label: 'Block content type'
mapping:
machine_name:
type: string
label: 'Output machine name'
<?php
/**
* @file
* Contains \Drupal\block_content\BlockContentViewsData.
*/
namespace Drupal\block_content;
use Drupal\views\EntityViewsData;
/**
* Provides the views data for the block_content entity type.
*/
class BlockContentViewsData extends EntityViewsData {
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();
$data['block_content']['id']['field']['id'] = 'block_content';
$data['block_content_field_data']['info']['field']['id'] = 'block_content';
$data['block_content_field_data']['info']['field']['link_to_entity default'] = TRUE;
$data['block_content_field_data']['type']['field']['id'] = 'block_content_type';
// @todo Figure out the way to integrate this automatic in
// content_translation https://www.drupal.org/node/2410261.
if ($this->moduleHandler->moduleExists('content_translation')) {
$data['block_content']['translation_link'] = array(
'title' => $this->t('Translation link'),
'help' => $this->t('Provide a link to the translations overview for custom blocks.'),
'field' => array(
'id' => 'content_translation_link',
),
);
}
// Advertise this table as a possible base table.
$data['block_content_revision']['table']['base']['help'] = $this->t('Block Content revision is a history of changes to block content.');
$data['block_content_revision']['table']['base']['defaults']['title'] = 'info';
// @todo EntityViewsData should add these relationships by default.
// https://www.drupal.org/node/2410275
$data['block_content_revision']['id']['relationship']['id'] = 'standard';
$data['block_content_revision']['id']['relationship']['base'] = 'block_content';
$data['block_content_revision']['id']['relationship']['base field'] = 'id';
$data['block_content_revision']['id']['relationship']['title'] = $this->t('Block Content');
$data['block_content_revision']['id']['relationship']['label'] = $this->t('Get the actual block content from a block content revision.');
$data['block_content_revision']['revision_id']['relationship']['id'] = 'standard';
$data['block_content_revision']['revision_id']['relationship']['base'] = 'block_content';
$data['block_content_revision']['revision_id']['relationship']['base field'] = 'revision_id';
$data['block_content_revision']['revision_id']['relationship']['title'] = $this->t('Block Content');
$data['block_content_revision']['revision_id']['relationship']['label'] = $this->t('Get the actual block content from a block content revision.');
$data['block_content_revision']['revision_log']['field']['id'] = 'xss';
return $data;
}
}
......@@ -26,6 +26,7 @@
* "access" = "Drupal\block_content\BlockContentAccessControlHandler",
* "list_builder" = "Drupal\block_content\BlockContentListBuilder",
* "view_builder" = "Drupal\block_content\BlockContentViewBuilder",
* "views_data" = "Drupal\block_content\BlockContentViewsData",
* "form" = {
* "add" = "Drupal\block_content\BlockContentForm",
* "edit" = "Drupal\block_content\BlockContentForm",
......
<?php
/**
* @file
* Contains \Drupal\block_content\Plugin\views\field\BlockContent.
*/
namespace Drupal\block_content\Plugin\views\field;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\views\ResultRow;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Field handler to provide simple renderer that allows linking to a block_content.
* Definition terms:
* - link_to_entity default: Should this field have the checkbox
* "link to entity" enabled by default.
*
* @ingroup views_field_handlers
*
* @ViewsField("block_content")
*/
class BlockContent extends FieldPluginBase {
/**
* The language manager.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* Constructs a new BlockContent.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The language manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager, EntityManagerInterface $entity_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->languageManager = $language_manager;
$this->entityManager = $entity_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('language_manager'),
$container->get('entity.manager')
);
}
/**
* {@inheritdoc}
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// Don't add the additional fields to groupby
if (!empty($this->options['link_to_entity'])) {
$this->additional_fields['id'] = array('table' => 'block_content', 'field' => 'id');
}
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['link_to_entity'] = array('default' => isset($this->definition['link_to_entity default']) ? $this->definition['link_to_entity default'] : FALSE);
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_entity'] = array(
'#title' => $this->t('Link this field to the original piece of block content'),
'#description' => $this->t("Enable to override this field's links."),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_entity']),
);
parent::buildOptionsForm($form, $form_state);
}
/**
* Prepares link to the block_content.
*
* @param string $data
* The XSS safe string for the link text.
* @param \Drupal\views\ResultRow $values
* The values retrieved from a single row of a view's query result.
*
* @return string
* Returns a string for the link text.
*/
protected function renderLink($data, ResultRow $values) {
if (!empty($this->options['link_to_entity']) && !empty($this->additional_fields['id'])) {
if ($data !== NULL && $data !== '') {
$id = $this->getValue($values, 'id');
$block_content = $this->entityManager->getStorage('block_content')->load($id);
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = $block_content->url();
if (isset($this->aliases['langcode'])) {
$languages = $this->languageManager->getLanguages();
$langcode = $this->getValue($values, 'langcode');
if (isset($languages[$langcode])) {
$this->options['alter']['language'] = $languages[$langcode];
}
else {
unset($this->options['alter']['language']);
}
}
}
else {
$this->options['alter']['make_link'] = FALSE;
}
}
return $data;
}
/**
* {@inheritdoc}
*/
public function render(ResultRow $values) {
$value = $this->getValue($values);
return $this->renderLink($this->sanitizeValue($value), $values);
}
}
<?php
/**
* @file
* Contains \Drupal\block_content\Plugin\views\field\Type.
*/
namespace Drupal\block_content\Plugin\views\field;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\ResultRow;
/**
* Field handler to translate a block content type into its readable form.
*
* @todo Remove this when https://www.drupal.org/node/2363811 is fixed.
*
* @ingroup views_field_handlers
*
* @ViewsField("block_content_type")
*/
class Type extends BlockContent {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['machine_name'] = array('default' => FALSE);
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['machine_name'] = array(
'#title' => $this->t('Output machine name'),
'#description' => $this->t('Display field as the block content type machine name.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['machine_name']),
);
}
/**
* Renders block content type name.
*
* @param string $data
* The block content type machine_name.
* @param \Drupal\views\ResultRow $values
* The values retrieved from a single row of a view's query result.
*
* @return string
* The block content type as human readable name or machine_name.
*/
public function renderName($data, ResultRow $values) {
if ($this->options['machine_name'] != 1 && $data !== NULL && $data !== '') {
$type = $this->entityManager->getStorage('block_content_type')->load($data);
return $type ? $this->t($this->sanitizeValue($type->label())) : '';
}
return $this->sanitizeValue($data);
}
/**
* {@inheritdoc}
*/
public function render(ResultRow $values) {
$value = $this->getValue($values);
return $this->renderLink($this->renderName($value, $values), $values);
}
}
<?php
/**
* @file
* Contains \Drupal\block_content\Tests\Views\BlockContentFieldFilterTest.
*/
namespace Drupal\block_content\Tests\Views;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\language\Entity\ConfigurableLanguage;
/**
* Tests block_content field filters with translations.
*
* @group block_content
*/
class BlockContentFieldFilterTest extends BlockContentTestBase {
/**
* {@inheritdoc}
*/
public static $modules = array('language');
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = array('test_field_filters');
/**
* List of block_content infos by language.
*
* @var array
*/
public $block_content_infos = array();
/**
* {@inheritdoc}
*/
function setUp() {
parent::setUp();
// Add two new languages.
ConfigurableLanguage::createFromLangcode('fr')->save();
ConfigurableLanguage::createFromLangcode('es')->save();
// Make the body field translatable. The info is already translatable by
// definition.
$field_storage = FieldStorageConfig::loadByName('block_content', 'body');
$field_storage->translatable = TRUE;
$field_storage->save();
// Set up block_content infos.
$this->block_content_infos = array(
'en' => 'Food in Paris',
'es' => 'Comida en Paris',
'fr' => 'Nouriture en Paris',
);
// Create block_content with translations.
$block_content = $this->createBlockContent(array('info' => $this->block_content_infos['en'], 'langcode' => 'en', 'type' => 'basic', 'body' => array(array('value' => $this->block_content_infos['en']))));
foreach (array('es', 'fr') as $langcode) {
$translation = $block_content->addTranslation($langcode, array('info' => $this->block_content_infos[$langcode]));
$translation->body->value = $this->block_content_infos[$langcode];
}
$block_content->save();
}
/**
* Tests body and info filters.
*/
public function testFilters() {
// Test the info filter page, which filters for info contains 'Comida'.
// Should show just the Spanish translation, once.
$this->assertPageCounts('test-info-filter', array('es' => 1, 'fr' => 0, 'en' => 0), 'Comida info filter');
// Test the body filter page, which filters for body contains 'Comida'.
// Should show just the Spanish translation, once.
$this->assertPageCounts('test-body-filter', array('es' => 1, 'fr' => 0, 'en' => 0), 'Comida body filter');
// Test the info Paris filter page, which filters for info contains
// 'Paris'. Should show each translation once.
$this->assertPageCounts('test-info-paris', array('es' => 1, 'fr' => 1, 'en' => 1), 'Paris info filter');
// Test the body Paris filter page, which filters for body contains
// 'Paris'. Should show each translation once.
$this->assertPageCounts('test-body-paris', array('es' => 1, 'fr' => 1, 'en' => 1), 'Paris body filter');
}
/**
* Asserts that the given block_content translation counts are correct.
*
* @param string $path
* Path of the page to test.
* @param array $counts
* Array whose keys are languages, and values are the number of times
* that translation should be shown on the given page.
* @param string $message
* Message suffix to display.
*/
protected function assertPageCounts($path, $counts, $message) {
// Get the text of the page.
$this->drupalGet($path);
$text = $this->getTextContent();
foreach ($counts as $langcode => $count) {
$this->assertEqual(substr_count($text, $this->block_content_infos[$langcode]), $count, 'Translation ' . $langcode . ' has count ' . $count . ' with ' . $message);
}
}
}
<?php
/**
* @file
* Contains \Drupal\block_content\Tests\Views\BlockContentIntegrationTest.
*/
namespace Drupal\block_content\Tests\Views;
/**
* Tests the block_content integration into views.
*
* @group block_content
*/
class BlockContentIntegrationTest extends BlockContentTestBase {
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = array('test_block_content_view');
/**
* Tests basic block_content view with a block_content_type argument.
*/
public function testBlockContentViewTypeArgument() {
// Create two content types with three block_contents each.
$types = array();
$all_ids = array();
$block_contents = array();
for ($i = 0; $i < 2; $i++) {
$type = $this->createBlockContentType();
$types[] = $type;
for ($j = 0; $j < 5; $j++) {
// Ensure the right order of the block_contents.
$block_content = $this->createBlockContent(array('type' => $type->id()));
$block_contents[$type->id()][$block_content->id()] = $block_content;
$all_ids[] = $block_content->id();
}
}
$this->drupalGet('test-block_content-view');
$this->assertResponse(404);
$this->drupalGet('test-block_content-view/all');
$this->assertResponse(200);
$this->assertIds($all_ids);
/* @var \Drupal\block_content\Entity\BlockContentType[] $types*/
foreach ($types as $type) {
$this->drupalGet("test-block_content-view/{$type->id()}");
$this->assertIds(array_keys($block_contents[$type->id()]));
}
}
/**
* Ensures that a list of block_contents appear on the page.
*
* @param array $expected_ids
* An array of block_content IDs.
*/
protected function assertIds(array $expected_ids = array()) {
$result = $this->xpath('//span[@class="field-content"]');
$ids = array();
foreach ($result as $element) {
$ids[] = (int) $element;
}
$this->assertEqual($ids, $expected_ids);
}
}
<?php
/**
* @file
* Contains \Drupal\block_content\Tests\Views\BlockContentTestBase.
*/
namespace Drupal\block_content\Tests\Views;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Component\Utility\String;
use Drupal\views\Tests\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
/**
* Base class for all block_content tests.
*/
abstract class BlockContentTestBase extends ViewTestBase {
/**
* Admin user
*
* @var object
*/
protected $adminUser;
/**
* Permissions to grant admin user.
*
* @var array
*/
protected $permissions = array(
'administer blocks',
);
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('block', 'block_content', 'block_content_test_views');
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
// Ensure the basic bundle exists. This is provided by the standard profile.
$this->createBlockContentType(array('id' => 'basic'));
$this->adminUser = $this->drupalCreateUser($this->permissions);
if ($import_test_views) {
ViewTestData::createTestViews(get_class($this), array('block_content_test_views'));
}
}
/**
* Creates a custom block.
*
* @param array $settings
* (optional) An associative array of settings for the block_content, as
* used in entity_create().
*
* @return \Drupal\block_content\Entity\BlockContent
* Created custom block.
*/
protected function createBlockContent(array $settings = array()) {
$status = 0;
$settings += array(
'info' => $this->randomMachineName(),
'type' => 'basic',
'langcode' => 'en',
);
if ($block_content = entity_create('block_content', $settings)) {
$status = $block_content->save();
}
$this->assertEqual($status, SAVED_NEW, String::format('Created block content %info.', array('%info' => $block_content->label())));
return $block_content;
}
/**
* Creates a custom block type (bundle).
*
* @param array $values
* An array of settings to change from the defaults.
*
* @return \Drupal\block_content\Entity\BlockContentType
* Created custom block type.
*/
protected function createBlockContentType(array $values = array()) {
// Find a non-existent random type name.
if (!isset($values['id'])) {
do {
$id = strtolower($this->randomMachineName(8));
} while (BlockContentType::load($id));
}
else {
$id = $values['id'];
}
$values += array(
'id' => $id,
'label' => $id,
'revision' => FALSE
);
$bundle = entity_create('block_content_type', $values);
$status = $bundle->save();
block_content_add_body_field($bundle->id());
$this->assertEqual($status, SAVED_NEW, String::format('Created block content type %bundle.', array('%bundle' => $bundle->id())));
return $bundle;
}
}
<?php
/**
* @file
* Contains \Drupal\block_content\Tests\Views\FieldTypeTest.
*/
namespace Drupal\block_content\Tests\Views;
use Drupal\views\Views;
/**
* Tests the Drupal\block_content\Plugin\views\field\Type handler.
*
* @group block_content
*/
class FieldTypeTest extends BlockContentTestBase {
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = array('test_field_type');
public function testFieldType() {
$block_content = $this->createBlockContent();
$expected_result[] = array(
'id' => $block_content->id(),
'block_content_field_data_type' => $block_content->bundle(),
);
$column_map = array(
'id' => 'id',
'block_content_field_data_type' => 'block_content_field_data_type',
);
$view = Views::getView('test_field_type');
$this->executeView($view);
$this->assertIdenticalResultset($view, $expected_result, $column_map, 'The correct block_content type was displayed.');
}
}
<?php
/**
* @file
* Contains \Drupal\block_content\Tests\Views\RevisionRelationshipsTest.
*/
namespace Drupal\block_content\Tests\Views;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\block_content\Entity\BlockContent;
use Drupal\views\Tests\ViewTestBase;
use Drupal\views\Views;
use Drupal\views\Tests\ViewTestData;
/**
* Tests the integration of block_content_revision table of block_content module.
*
* @group block_content
*/
class RevisionRelationshipsTest extends ViewTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('block_content' ,'block_content_test_views');
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = array('test_block_content_revision_id', 'test_block_content_revision_revision_id');
protected function setUp() {
parent::setUp();
BlockContentType::create(array(
'id' => 'basic',
'label' => 'basic',
'revision' => TRUE,
));
ViewTestData::createTestViews(get_class($this), array('block_content_test_views'));
}
/**
* Create a block_content with revision and rest result count for both views.
*/
public function testBlockContentRevisionRelationship() {
$block_content = BlockContent::create(array(
'info' => $this->randomMachineName(),
'type' => 'basic',
'langcode' => 'en',
));
$block_content->save();
// Create revision of the block_content.
$block_content_revision = clone $block_content;
$block_content_revision->setNewRevision();
$block_content_revision->save();
$column_map = array(
'revision_id' => 'revision_id',
'block_content_revision_id' => 'block_content_revision_id',
'block_content_block_content_revision_id' => 'block_content_block_content_revision_id',
);
// Here should be two rows.
$view_id = Views::getView('test_block_content_revision_id');
$this->executeView($view_id, array($block_content->id()));
$resultset_id = array(
array(
'revision_id' => '1',
'block_content_revision_id' => '1',
'block_content_block_content_revision_id' => '1',
),
array(
'revision_id' => '2',
'block_content_revision_id' => '1',
'block_content_block_content_revision_id' => '1',
),
);
$this->assertIdenticalResultset($view_id, $resultset_id, $column_map);
// There should be only one row with active revision 2.
$view_revision_id = Views::getView('test_block_content_revision_revision_id');
$this->executeView($view_revision_id, array($block_content->id()));
$resultset_revision_id = array(
array(
'revision_id' => '2',
'block_content_revision_id' => '1',
'block_content_block_content_revision_id' => '1',
),
);
$this->assertIdenticalResultset($view_revision_id, $resultset_revision_id, $column_map);
}
}
name: 'Block Content test views'
type: module
description: 'Provides default views for views block_content tests.'
package: Testing
version: VERSION
core: 8.x
dependencies:
- block_content
- views
langcode: und
status: true
dependencies:
module:
- block_content
id: test_block_content_revision_id
label: null
module: views
description: ''
tag: ''
base_table: block_content_revision
base_field: revision_id
core: '8'
display:
default:
display_options:
relationships:
id:
id: id
table: block_content_revision
field: id
required: true
plugin_id: standard
fields:
revision_id:
id: revision_id
table: block_content_revision
field: revision_id
plugin_id: numeric
entity_type: block_content
entity_field: revision_id
id_1:
id: id_1
table: block_content_revision
field: id
plugin_id: standard
entity_type: block_content
entity_field: id
id:
id: id
table: block_content
field: id
relationship: id
plugin_id: block_content
entity_type: block_content
entity_field: id
arguments:
id:
id: id
table: block_content_revision
field: id
plugin_id: numeric
entity_type: block_content
entity_field: id
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
display_plugin: default
display_title: Master
id: default
position: 0
langcode: und
status: true
dependencies:
module:
- block_content
id: test_block_content_revision_revision_id
label: null
module: views
description: ''
tag: ''
base_table: block_content_revision
base_field: revision_id
core: '8'
display:
default:
display_options:
relationships:
revision_id:
id: revision_id
table: block_content_revision
field: revision_id
required: true
entity_type: block_content
entity_field: revision_id
plugin_id: standard
fields:
revision_id:
id: revision_id
table: block_content_revision
field: revision_id
plugin_id: standard
entity_type: block_content
entity_field: revision_id
id_1:
id: id_1
table: block_content_revision
field: id
plugin_id: standard
entity_type: block_content
entity_field: id
id:
id: id
table: block_content
field: id
relationship: revision_id
plugin_id: block_content
entity_type: block_content
entity_field: id
arguments:
id:
id: id
table: block_content_revision
field: id
plugin_id: block_content_id
entity_type: block_content
entity_field: id
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
display_extenders: { }
display_plugin: default
display_title: Master
id: default
position: 0
langcode: en
status: true
dependencies:
module:
- block_content
id: test_block_content_view
label: test_block_content_view
module: views
description: ''
tag: ''
base_table: block_content
base_field: id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: null
display_options:
access:
type: none
options: { }
cache:
type: none
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: false
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: full
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ' previous'
next: 'next ›'
first: '« first'
last: 'last »'
quantity: 9
style:
type: default
row:
type: fields
fields:
id:
id: id
table: block_content
field: id
relationship: none
group_type: group
admin_label: ''
label: Id
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: ''
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
link_to_entity: false
plugin_id: block_content
entity_type: block_content
entity_field: id
sorts: { }
title: test_block_content_view
header: { }
footer: { }
empty: { }
relationships: { }
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
display_extenders: { }
arguments:
type:
id: type
table: block_content
field: type
relationship: none
group_type: group
admin_label: ''
default_action: 'not found'
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: false
validate:
type: none
fail: 'not found'
validate_options: { }
glossary: false
limit: 0
case: none
path_case: none
transform_dash: false
break_phrase: false
entity_type: block_content
entity_field: type
plugin_id: string
page_1:
display_plugin: page
id: page_1
display_title: Page
position: null
display_options:
path: test-block_content-view
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
display_extenders: { }
langcode: en
status: true
dependencies:
module:
- block_content
id: test_field_filters
label: 'Test field filters'
module: views
description: ''
tag: ''
base_table: block_content
base_field: id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: none
options: { }
cache:
type: none
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: false
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: none
options:
items_per_page: 0
offset: 0
style:
type: default
row:
type: 'entity:block_content'
options:
relationship: none
view_mode: default
fields:
info:
id: info
table: block_content_field_data
field: info
label: ''
alter:
alter_text: false
make_link: false
absolute: false
trim: false
word_boundary: false
ellipsis: false
strip_tags: false
html: false
hide_empty: false
empty_zero: false
link_to_entity: true
relationship: none
group_type: group
admin_label: ''
exclude: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_alter_empty: true
entity_type: block_content
entity_field: title
plugin_id: block_content
filters:
info:
id: info
table: block_content_field_data
field: info
relationship: none
group_type: group
admin_label: ''
operator: contains
value: Paris
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: string
entity_type: block_content
entity_field: info
sorts:
changed:
id: changed
table: block_content_field_data
field: changed
order: DESC
relationship: none
group_type: group
admin_label: ''
exposed: false
expose:
label: ''
granularity: second
plugin_id: date
entity_type: block_content
entity_field: changed
title: 'Test field filters'
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
rendering_language: translation_language_renderer
display_extenders: { }
page_bf:
display_plugin: page
id: page_bf
display_title: 'Body filter page'
position: 1
display_options:
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
path: test-body-filter
display_description: ''
title: 'Test body filters'
defaults:
title: false
filters: false
filter_groups: false
filters:
body_value:
id: body_value
table: block_content__body
field: body_value
relationship: none
group_type: group
admin_label: ''
operator: contains
value: Comida
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: string
entity_type: block_content
entity_field: body
filter_groups:
operator: AND
groups:
1: AND
display_extenders: { }
page_bfp:
display_plugin: page
id: page_bfp
display_title: 'Body filter page Paris'
position: 1
display_options:
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
path: test-body-paris
display_description: ''
title: 'Test body filters'
defaults:
title: false
filters: false
filter_groups: false
filters:
body_value:
id: body_value
table: block_content__body
field: body_value
relationship: none
group_type: group
admin_label: ''
operator: contains
value: Paris
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: string
entity_type: block_content
entity_field: body
filter_groups:
operator: AND
groups:
1: AND
display_extenders: { }
page_if:
display_plugin: page
id: page_if
display_title: 'Info filter page'
position: 1
display_options:
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
path: test-info-filter
display_description: ''
title: 'Test info filter'
defaults:
title: false
filters: false
filter_groups: false
filters:
info:
id: info
table: block_content_field_data
field: info
relationship: none
group_type: group
admin_label: ''
operator: contains
value: Comida
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: string
entity_type: block_content
entity_field: info
filter_groups:
operator: AND
groups:
1: AND
display_extenders: { }
page_ifp:
display_plugin: page
id: page_ifp
display_title: 'Info filter page Paris'
position: 1
display_options:
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
path: test-info-paris
display_description: ''
title: 'Test info filter'
defaults:
title: false
display_extenders: { }
langcode: und
status: true
dependencies:
module:
- block_content
id: test_field_type
label: ''
module: views
description: ''
tag: ''
base_table: block_content
base_field: id
core: '8'
display:
default:
display_options:
fields:
type:
field: type
id: type
table: block_content_field_data
plugin_id: block_content_type
entity_type: block_content
entity_field: type
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
display_plugin: default
display_title: Master
id: default
position: 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment