-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OEL-1543: Rename block templates to target plugin ids instead of block ids. #137
Changes from all commits
6cd1ef5
d5bc4a1
fd09b47
5d7980d
0e8ec65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,10 +122,10 @@ public function testBlockRendering(): void { | |
$render = $this->container->get('renderer')->renderRoot($build); | ||
$crawler = new Crawler($render->__toString()); | ||
|
||
// Assert the form rendering. | ||
$block = $crawler->filter('#block-whitelabel-search-block'); | ||
$this->assertCount(1, $block); | ||
$form = $block->filter('#oe-whitelabel-search-form'); | ||
// Select the search form in the block. | ||
// The block template removes the block wrapper, so the form is the root | ||
// element. | ||
$form = $crawler->filter('body > form#oe-whitelabel-search-form'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it adds clarity to also have |
||
$this->assertCount(1, $form); | ||
$this->assertSame('d-flex mt-3 mt-lg-0', $form->attr('class')); | ||
// Assert the field wrapper rendering. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{# | ||
/** | ||
* @file | ||
* Override for blocks with plugin id = 'language_block:language_interface'. | ||
* | ||
* @see \Drupal\language\Plugin\Block\LanguageBlock | ||
*/ | ||
#} | ||
{% block content %} | ||
<div class="language-switcher-block nav-link"> | ||
{{ content }} | ||
</div> | ||
{% endblock %} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{# | ||
/** | ||
* @file | ||
* Theme block implementation to display facet form. | ||
* Override for blocks with plugin id = 'facets_form'. | ||
* | ||
* @see ./core/themes/stable/templates/block/block.html.twig | ||
* @see \Drupal\facets_form\Plugin\Block\FacetsFormBlock | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These comments had changed in 1.x since before last rebase. |
||
*/ | ||
#} | ||
|
||
{% if content.actions.reset['#type'] == 'link' %} | ||
{% set extra_attributes = create_attribute() %} | ||
{% set reset = pattern('link', { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{# | ||
/** | ||
* @file | ||
* Theme block implementation to display facets summary. | ||
* Override for blocks with plugin id = 'facets_summary_block'. | ||
* | ||
* @see ./core/themes/stable/templates/block/block.html.twig | ||
* @see \Drupal\facets_summary\Plugin\Block\FacetsSummaryBlock | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These comments had changed in 1.x since before last rebase. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, think their better, since the location of the indicated block template should have been the block module not the stable theme |
||
*/ | ||
#} | ||
{% if label and content['#items'][0]['#theme'] is defined and content['#items'][0]['#theme'] == 'facets_summary_count' %} | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{# | ||
/** | ||
* @file | ||
* Override for blocks with plugin id = 'whitelabel_search_block'. | ||
* | ||
* Removes outer wrapper div and block label. | ||
* | ||
* @see \Drupal\oe_whitelabel_search\Plugin\Block\SearchBlock | ||
*/ | ||
#} | ||
{% block content %} | ||
{{ content }} | ||
{% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to rename the variables here, but I then decided to rather not touch this part.
E.g.
$render
->$markup
,$entity
->$block_entity
.We can do this another day.