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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
manage_display
Commits
975f6818
Commit
975f6818
authored
7 years ago
by
AdamPS
Browse files
Options
Downloads
Patches
Plain Diff
Rename the formatter
parent
a5111ce4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manage_display.module
+1
-5
1 addition, 5 deletions
manage_display.module
src/Plugin/Field/FieldFormatter/TitleFormatter.php
+6
-6
6 additions, 6 deletions
src/Plugin/Field/FieldFormatter/TitleFormatter.php
with
7 additions
and
11 deletions
manage_display.module
+
1
−
5
View file @
975f6818
...
...
@@ -31,11 +31,7 @@ function manage_display_entity_base_field_info_alter(&$base_field_definitions, E
function
manage_display_base_field_info
(
$entity_type_id
)
{
$info
[
'node'
][
'title'
]
=
[
'label'
=>
'hidden'
,
'type'
=>
'linked_and_wrapped'
,
'settings'
=>
[
'tag'
=>
'h2'
,
'linked'
=>
'1'
,
],
'type'
=>
'title'
,
'weight'
=>
-
5
,
];
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/Field/FieldFormatter/
LinkedAndWrapped
.php
→
src/Plugin/Field/FieldFormatter/
TitleFormatter
.php
+
6
−
6
View file @
975f6818
...
...
@@ -9,17 +9,17 @@ use Drupal\Core\Routing\LinkGeneratorTrait;
use
Drupal\Core\Template\Attribute
;
/**
* A field formatter for
linking and wrapping text
.
* A field formatter for
entity titles
.
*
* @FieldFormatter(
* id = "
linked_and_wrapped
",
* label = @Translation("
Linked & Wrapped
"),
* id = "
title
",
* label = @Translation("
Title
"),
* field_types = {
* "string"
* }
* )
*/
class
LinkedAndWrapped
extends
BasicStringFormatter
{
class
TitleFormatter
extends
BasicStringFormatter
{
use
LinkGeneratorTrait
;
...
...
@@ -89,14 +89,14 @@ class LinkedAndWrapped extends BasicStringFormatter {
$form
[
'tag'
]
=
[
'#title'
=>
$this
->
t
(
'Tag'
),
'#type'
=>
'select'
,
'#description'
=>
$this
->
t
(
'Select the tag which will be wrapped around the t
ext
.'
),
'#description'
=>
$this
->
t
(
'Select the tag which will be wrapped around the t
itle
.'
),
'#options'
=>
$heading_options
,
'#default_value'
=>
$this
->
getSetting
(
'tag'
),
];
$form
[
'linked'
]
=
[
'#title'
=>
$this
->
t
(
'Link to the Content'
),
'#type'
=>
'checkbox'
,
'#description'
=>
$this
->
t
(
'Wrap the t
ext
with a link to the content.'
),
'#description'
=>
$this
->
t
(
'Wrap the t
itle
with a link to the content.'
),
'#default_value'
=>
$this
->
getSetting
(
'linked'
),
];
$form
[
'classes'
]
=
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment