Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b4c0a16a
Commit
b4c0a16a
authored
Dec 02, 2014
by
alexpott
Browse files
Issue
#2345343
by damiankloip, dawehner, olli, Bès: view TITLE appears all the time
parent
d07e48a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/views/src/Tests/Plugin/DisplayPageWebTest.php
View file @
b4c0a16a
...
...
@@ -7,6 +7,8 @@
namespace
Drupal\views\Tests\Plugin
;
use
Drupal\views\Views
;
/**
* Tests the views page display plugin as webtest.
*
...
...
@@ -19,7 +21,7 @@ class DisplayPageWebTest extends PluginTestBase {
*
* @var array
*/
public
static
$testViews
=
array
(
'test_page_display_arguments'
,
'test_page_display_menu'
);
public
static
$testViews
=
array
(
'test_page_display'
,
'test_page_display_arguments'
,
'test_page_display_menu'
);
/**
* Modules to enable.
...
...
@@ -121,4 +123,15 @@ public function testPageDisplayMenu() {
$this
->
assertEqual
((
string
)
$menu_link
[
0
],
'New title'
);
}
/**
* Tests the title is not displayed in the output.
*/
public
function
testTitleOutput
()
{
$this
->
drupalGet
(
'test_page_display_200'
);
$view
=
Views
::
getView
(
'test_page_display'
);
$xpath
=
$this
->
cssSelect
(
'div.view:contains("'
.
$view
->
getTitle
()
.
'")'
);
$this
->
assertFalse
(
$xpath
,
'The view title was not displayed in the view markup.'
);
}
}
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display.yml
View file @
b4c0a16a
...
...
@@ -12,6 +12,7 @@ core: '8'
display
:
default
:
display_options
:
title
:
'
Test
page
display'
defaults
:
fields
:
false
pager
:
false
...
...
core/modules/views/views.theme.inc
View file @
b4c0a16a
...
...
@@ -28,6 +28,11 @@ function template_preprocess_views_view(&$variables) {
$variables
[
'css_name'
]
=
Html
::
cleanCssIdentifier
(
$id
);
$variables
[
'id'
]
=
$id
;
$variables
[
'display_id'
]
=
$view
->
current_display
;
// Override the title to be empty by default. For example, if viewing a page
// view, 'title' will already be populated in $variables. This can still be
// overridden to use a title when needed. See views_ui_preprocess_views_view()
// for an example of this.
$variables
[
'title'
]
=
''
;
// Basic classes.
$variables
[
'attributes'
][
'class'
]
=
array
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment