Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_formatter
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
field_formatter
Commits
8c00b9aa
Commit
8c00b9aa
authored
5 years ago
by
Julian Pustkuchen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed code style.
parent
dcfe1b03
Branches
8.x-1.x
Branches containing commit
Tags
3.0.0-alpha0
3.0.0-alpha1
8.x-2.0-beta1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/Field/FieldFormatter/FieldFormatterBase.php
+18
-18
18 additions, 18 deletions
src/Plugin/Field/FieldFormatter/FieldFormatterBase.php
with
18 additions
and
18 deletions
src/Plugin/Field/FieldFormatter/FieldFormatterBase.php
+
18
−
18
View file @
8c00b9aa
...
...
@@ -102,30 +102,30 @@ abstract class FieldFormatterBase extends EntityReferenceFormatterBase {
$entityUrl
=
$entity
->
toUrl
();
/*
TODO: This implementation overwrites the ['#url'] value of the
selected field, which only works for fields what support
['#url'] and has the advantage that no extra wrapper is created
AND links in links are prevented. Anyway this will not work for
all field types.
TODO: This implementation overwrites the ['#url'] value of the
selected field, which only works for fields what support
['#url'] and has the advantage that no extra wrapper is created
AND links in links are prevented. Anyway this will not work for
all field types.
*/
foreach
(
$entityDisplay
as
$field_name
=>
&
$field
)
{
$field
[
0
][
'#url'
]
=
$entityUrl
;
}
/*
TODO: Alternative from field_link formatter, which should
work for all field types but may lead to links in links
and additional wrapper markup.
$field_name = $this->fieldDefinition->getName();
$field_output = isset($entityDisplay[$field_name]) ?
$entityDisplay[$field_name] : [];
foreach (Element::children($field_output) as $key) {
$entityDisplay[$field_name][$key] = [
'#type' => 'link',
'#url' => $entityUrl,
'#title' => $field_output[$key],
];
}
TODO: Alternative from field_link formatter, which should
work for all field types but may lead to links in links
and additional wrapper markup.
$field_name = $this->fieldDefinition->getName();
$field_output = isset($entityDisplay[$field_name]) ?
$entityDisplay[$field_name] : [];
foreach (Element::children($field_output) as $key) {
$entityDisplay[$field_name][$key] = [
'#type' => 'link',
'#url' => $entityUrl,
'#title' => $field_output[$key],
];
}
*/
}
$build
[
$delta
]
=
$entityDisplay
;
...
...
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