Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
manage_display
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
manage_display
Merge requests
!2
Issue
#3143678
by ckng: Allow node/entity to display title/label field as normal
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Closed
Issue
#3143678
by ckng: Allow node/entity to display title/label field as normal
issue/manage_display-3143678:ckng-8.x-1.x-patch-20815
into
8.x-1.x
Overview
0
Commits
1
Pipelines
0
Changes
1
Closed
Issue #3143678 by ckng: Allow node/entity to display title/label field as normal
Chin Kiong Ng
requested to merge
issue/manage_display-3143678:ckng-8.x-1.x-patch-20815
into
8.x-1.x
Jun 24, 2021
Overview
0
Commits
1
Pipelines
0
Changes
1
Resolve
#3143678
0
0
Merge request reports
Compare
8.x-1.x
8.x-1.x (base)
and
latest version
latest version
68747257
1 commit,
Jun 24, 2021
1 file
+
8
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
manage_display.module
+
8
−
6
View file @ 68747257
Edit in single-file editor
Open in Web IDE
Show full file
@@ -6,6 +6,8 @@
*/
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\node\Entity\Node
;
use
Drupal\Core\Entity\Display\EntityViewDisplayInterface
;
use
Drupal\Core\Form\FormStateInterface
;
/**
@@ -129,11 +131,11 @@ function manage_display_form_node_type_form_alter(&$form, FormStateInterface $fo
}
/**
* Implements hook_
form_FORM_ID_alter()
.
* Implements hook_
ENTITY_TYPE_view() for node entities
.
*/
function
manage_display_
form_system_theme_settings_alter
(
&
$form
,
FormStateInterface
$form_state
,
$form_id
)
{
// Hide the theme settings for user_pictures because the submitted formatter
// has its own setting.
$
form
[
'theme_settings'
][
'toggle_node_user_picture'
][
'#access'
]
=
FALSE
;
//$form['theme_settings']['toggle_comment_user_picture']['#access'] = FALSE
;
function
manage_display_
node_view
(
array
&
$build
,
Node
$entity
,
EntityViewDisplayInterface
$display
,
$view_mode
)
{
$build
[
'title_field'
]
=
$build
[
'title'
];
$title_field
=
$display
->
getComponent
(
'title'
);
$
build
[
'title_field'
][
'#weight'
]
=
$title_field
[
'weight'
]
;
unset
(
$build
[
'title'
])
;
}
Loading