From 46d59d6c8aa78b9eb0207fb7f34592df9988aa8c Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Mon, 7 Sep 2015 18:07:19 +0100 Subject: [PATCH] Issue #2513556 by dcmul, mohit_aghera, cilefen, subhojit777, hussainweb, Bojhan, eliza411, ivanstegic, LewisNyman, lunk_rat, nickrosencrans, stpaultim, Mark LaCroix, webchick: Add a link to the Block Layout page on the Appearance page --- core/modules/block/src/Tests/BlockTest.php | 16 ++++++++++++++++ core/modules/system/system.module | 3 +++ 2 files changed, 19 insertions(+) diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php index 843af6db262..bd360f680af 100644 --- a/core/modules/block/src/Tests/BlockTest.php +++ b/core/modules/block/src/Tests/BlockTest.php @@ -410,6 +410,22 @@ class BlockTest extends BlockTestBase { $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS'); } + /** + * Tests that a link exists to block layout from the appearance form. + */ + public function testThemeAdminLink() { + $this->drupalPlaceBlock('help_block', ['region' => 'help']); + $theme_admin = $this->drupalCreateUser([ + 'administer blocks', + 'administer themes', + 'access administration pages', + ]); + $this->drupalLogin($theme_admin); + $this->drupalGet('admin/appearance'); + $this->assertText('You can place blocks for each theme on the block layout page'); + $this->assertLinkByHref('admin/structure/block'); + } + /** * Tests that uninstalling a theme removes its block configuration. */ diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 923e722027b..c12a2d4b979 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -105,6 +105,9 @@ function system_help($route_name, RouteMatchInterface $route_match) { case 'system.themes_page': $output = '

' . t('Set and configure the default theme for your website. Alternative themes are available.', array('!themes' => 'https://www.drupal.org/project/themes')) . '

'; + if (\Drupal::moduleHandler()->moduleExists('block')) { + $output .= '

' . t('You can place blocks for each theme on the block layout page.', array('@blocks' => \Drupal::url('block.admin_display'))) . '

'; + } return $output; case 'system.theme_settings_theme':