Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Reporter:
Created:
20 Mar 2017 at 20:11 UTC
Updated:
24 Apr 2017 at 09:35 UTC
Jump to comment: Most recent, Most recent file
Followup from #2852126: Improve paragraphs display in the library overview.The paragraphs library overview displays library items as rendered entities in a default view mode.
We could add a new view mode, showing just the summary for library items and use it instead (in the overview).
Provide a paragraphs formatter showing just the summary.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | create_paragraphs-2862284-20.patch | 7.71 KB | ginovski |
| #20 | interdiff-2862284-18-20.txt | 1.29 KB | ginovski |
| #18 | create_paragraphs-2862284-18.patch | 8.4 KB | ginovski |
| #18 | interdiff-2862284-9-18.txt | 2.13 KB | ginovski |
| #2 | create_paragraphs-2862284-2.patch | 1.71 KB | ginovski |
Comments
Comment #2
ginovski commentedAdded paragraphs formatter.
Comment #3
ginovski commentedComment #5
miro_dietikerThe summary is an admin UI output, here intentionally for a super compact output inside an administrative table.
The teaser output is typically a frontend output.
IMHO we should not use the term "teaser" for an admin UI view mode.
Comment #6
ginovski commentedRe-added the formatter, think it will apply this time.
Addressed #5 comment, changed issue description.
Comment #7
ginovski commentedRemoved unrelated change from previous patch.
Comment #8
primsi commentedParagraphsFormatter is to generic IMHO. We should name this something like ParagraphsSummaryFormatter
Inject
Direction is in my opinion good. But we need to add tests.
Comment #9
ginovski commentedChanged name to ParagraphsSummaryFormatter.
Added tests.
About the injection, the method is static, so it cannot use $this.
Comment #10
primsi commentedComment #11
primsi commentedComment #12
primsi commentedOld issue with an interesting link in #11: #2433933: Paragraph summary formatter
Comment #13
primsi commentedWe have a lot of room for improvement in the summary area. But we could keep it simple here, so that other issues can have something to work on and we can improve it later.
I think loading of additional information should be done in prepareView. See \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase::prepareView for example.
Also I see that in EntityRefferenceFormatterBase::view core tries add acces result cacheability information. Not sure if we need something similar here in the light of behavior lockable plugin. More opinions regarding that woud be wellcome.
Comment #14
primsi commentedComment #15
berdirlockable is edit, that doesn't apply here but yes, we need to respect entity view access, which
But yes, that code is very strange, just do $item->entity. And actually, in that method, the correct thing to do is the same as all other formatters, that is foreach ($this->getEntitiesToView($items, $langcode) as $delta => $entity) {
Comment #16
miro_dietikerThis is blocking progress for the library in collection. Plz link.
Comment #17
miro_dietikerComment #18
ginovski commented1. Loading paragraphs in prepareView.
2. Adding the markup through getEntitiesToView().
Comment #19
berdirI don't see why we need to override prepareView(), isn't that the same as the parent?
Comment #20
ginovski commentedRemoved prepareView.
Comment #22
primsi commentedCommitted, thanks.