API page: https://api.drupal.org/api/drupal/core%21modules%21block%21templates%21b...

configuration.module does not output the module providing the block, after debugging with,

{% if configuration|length > 0 %}
{% for key, config in configuration %}
{{ key }}: {{ config }}
{% endfor %}

I found that it was actually configuration.provider, that provided what the block was being generated from.

Comments

benjamin.merkley created an issue. See original summary.

benjamin.merkley’s picture

jhodgdon’s picture

Title: configuration.module Variable Key incorrect » block.html.twig variable docs have an error
Issue tags: +Novice, +rc eligible

Ah. So it looks like we need to change the docs header in block.html.twig, where it says:
- module: ...
to
- provider: ...
(under the "configuration" item in available variables section).

Good novice issue.

And by the way there are unfortunately 3 block.html.twig files that need this update :(

krknth’s picture

Assigned: Unassigned » krknth
Status: Active » Needs review
FileSize
4.36 KB

Not sure, But might be changed in following all places. suggest!

core/modules/block/templates/block.html.twig
core/modules/system/templates/block--system-menu-block.html.twig
core/themes/bartik/templates/block.html.twig
core/themes/classy/templates/block/block--search-form-block.html.twig
core/themes/classy/templates/block/block--system-menu-block.html.twig
core/themes/classy/templates/block/block.html.twig

changed from 'module' to 'provider', do we need to change description too ?

benjamin.merkley’s picture

Question as well, Is there any way I can call the region that block is in using twig?

jhodgdon’s picture

Status: Needs review » Needs work

RE #5, this is now a Documentation bug. Please look elsewhere for programming support. Thanks! There are several support options listed if you click on "Support" at the top of Drupal.org, which will take you to:
http://drupal.org/support
There you can find out about the Drupal IRC channels, and the Forums, which are our two main support mechanisms in the Drupal community. You might also try http://drupal.stackexchange.com/

Good luck with your question!

----

So that aside, the patch looks good to me... though you're right, maybe we should change the description. A block can (theoretically) be provided by a module, installation profile, theme, or "core". So we should probably say something about that. Maybe just "module or other provider" ?

krknth’s picture

Status: Needs work » Needs review
FileSize
4.47 KB
4.29 KB

Updated

- *   - provider: The module that provided this block plugin.
+ *   - provider: The module or other provider that provided this block plugin.

The last submitted patch, 4: 2604324-1.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: 2604324-2.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

Thanks! Lastest patch looks fine. Test failure was due to a bunch of tests getting aborted by ... who knows what/why/whom.

Cottser’s picture

Issue tags: +Twig

+1, thanks!

Wim Leers’s picture

Status: Reviewed & tested by the community » Needs review

Hrm, this made me realize that the cache line just below each of the modified lines is also completely obsolete: we need to remove those lines too.

IMO it makes sense to do that here?

Cottser’s picture

Assigned: krknth » Unassigned
Status: Needs review » Needs work

Sure, so it sounds like we just need to remove those parts? Unassigning, @krknth if you have time to pick this up feel free to reassign.

Wim Leers’s picture

Yep, just remove those parts.

anil280988’s picture

Removed Cache parts.

anil280988’s picture

Status: Needs work » Needs review

Changing status

krknth’s picture

@anil280988 : Thanks!

Wim Leers’s picture

Status: Needs review » Needs work
+++ b/core/themes/classy/templates/block/block.html.twig
@@ -9,7 +9,6 @@
  *   - cache: The cache settings.

You forgot this one.

krknth’s picture

Assigned: Unassigned » krknth

I'm working on

krknth’s picture

@anil280988 : your removed module, but not added provider ? any reason ?

diff --git a/core/themes/classy/templates/block/block.html.twig b/core/themes/classy/templates/block/block.html.twig
index 8b584b9..6cc472b 100644
--- a/core/themes/classy/templates/block/block.html.twig
+++ b/core/themes/classy/templates/block/block.html.twig
@@ -9,7 +9,6 @@
  * - configuration: A list of the block's configuration values.
  *   - label: The configured label for the block.
  *   - label_display: The display settings for the label.
- *   - module: The module that provided this block plugin.
  *   - cache: The cache settings.
  *   - Block plugin specific settings will also be stored here.
  * - content: The content of this block.
krknth’s picture

Status: Needs work » Needs review
FileSize
4.89 KB
3.96 KB

Added patch & interdiff for #7 - #21

krknth’s picture

Assigned: krknth » Unassigned
Wim Leers’s picture

Title: block.html.twig variable docs have an error » block.html.twig variable docs are incorrect
Status: Needs review » Reviewed & tested by the community

#21 is identical to #7, which was RTBC'd in #10, but now with the additional deletions I requested in #12. Which makes this RTBC again :)

Thanks!

  • alexpott committed d0b0b4a on 8.0.x
    Issue #2604324 by krknth, anil280988: block.html.twig variable docs are...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed d0b0b4a and pushed to 8.0.x. Thanks!

Status: Fixed » Needs work

The last submitted patch, 21: 2604324-21.patch, failed testing.

alexpott’s picture

Status: Needs work » Fixed
benjamin.merkley’s picture

Status: Fixed » Needs review

Outputting {{configuration.provider}} in the block.twig.html file works for most blocks, but doesn't appear to work with the Main Navigation block.

The last submitted patch, 4: 2604324-1.patch, failed testing.

The last submitted patch, 7: 2604324-2.patch, failed testing.

The last submitted patch, 15: 2604324-15.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 21: 2604324-21.patch, failed testing.

Wim Leers’s picture

Status: Needs work » Fixed

Testbot's lagging.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.