Closed effapp closed 1 week ago
Model.Content.AbstractContent is null in Summary View but is not null in details view like Content-Article.cshtml
How I would understand that happens is:
DisplayAsync(Model.Content.AbstractContent)
means the shape named AbstractContent
in the zone named Content
of the current Model
which is a zone holder shape.
So it looks like this shape is not created for the Summary display mode.
can you describe what your Article content type is made of, and how you create the summary shapes of your articles, or where you are trying to "see" them if the view already exists? (the admin uses SummaryAdmin for instance).
Place it using placement for Summary view
@ns8482e I almost believe you like placement ;)
Hi @sebastienros ,
I think that since "DisplayAsync(Model.Content.AbstractContent)" can be displayed in details view , it should be displayed in summary view.
note: I use oc 1.8.4
Hi @sebastienros ,
Article type:
Content-Article.cshtml
Content-Article.Summary.cshtml
@ns8482e I almost believe you like placement ;)
Creation of AbstractContent
within Content
depends DisplayDriver of Content part that creates it. Here the part in question is FlowPart which is not placed in Summary view only placed when it's Detail view.
So if there is need to render flow part detail into summary view then, it requires placement definition explicitly.
@ns8482e I realized that after your comment actually. And I think that's totally ok in term of design, a summary should not display everything like in Details.
But it's also ok because there is a way to change that: Placement!!!
Let's try to get the correct placement syntax then:
{
"FlowPart": [
{
"place": "Content",
// "differentiator": "AbstractContent",
"contentType": "Article",
"displayType": "Summary"
}
]
}
If not this, it should be close.
Now reflecting on it, I think we should have the list of all available shape types for each part/field (we probably have it for fields, I can vaguely remember creating this list once). And explain in placement how to use this list based on the custom part names, how to build the differentiator ... (which I also feel like I documented at some point).
Also worth mentioning that the FlowPart_Empty
shape is used when the part has no elements.
https://docs.orchardcore.net/en/latest/reference/modules/Flow/#empty-flows-and-bags
In details view Content-Article.cshtml, "@await DisplayAsync(Model.Content.AbstractContent)" can render correctly but in summary view Content-Article.Summary.cshtml "@await DisplayAsync(Model.Content.AbstractContent)" render nothing.
Note: Model.Content.AbstractContent is FlowPart