-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Placements module v2 #7483
Placements module v2 #7483
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
When is the demo? :)
Couple of minor comments.
I know I asked you to move it to the database last time, which is great, thank you.
For the future we could also have the file option (as a feature) - both have good uses.
...ore/OrchardCore.Application.Cms.Core.Targets/OrchardCore.Application.Cms.Core.Targets.csproj
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Placements/Services/IPlacementsManager.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditTypePart.cshtml
Show resolved
Hide resolved
This might be too much work / impossible but could we add hints to the different placement options using the ContentDefinitionManager ? For example, instead of having a "placement rule" code mirror field, could we generate inputs / dropdowns, etc for each of the placement options ? |
@deanmarcussen thanks for the review.
Of course, I will add an abstraction of the storage.
It could be possible, but placement node format is extensible (with |
For info we already have an implementation of a generic
And an implementation of
Allowing to just inject
|
What's the priority of conflicting placements with this feature? Say I have placement in my theme for FooField, then there is one in the feature FooField module, and then another in the UI for FooField with the same shape differentiator etc but a different place rule for example. |
I don't like shapes, or placement (on the front-end), but I am ok with this kind of PR. |
Done !
PlacementInfo are combined (see PlacementInfoExtensions.cs). |
Placements are closely related to Display and not Content - So It would be nice to refactor the module into Abstractions, Core, Module to support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, really just a bit of formatting, and conventions to do.
(Plus merge dev - conflicts)
Nice job on adding the file store too
src/OrchardCore.Modules/OrchardCore.Placements/OrchardCore.Placements.csproj
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Placements/Views/Admin/Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Placements/Views/Admin/Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Placements/Views/PlacementSettings.cshtml
Outdated
Show resolved
Hide resolved
<a asp-route-action="Edit" asp-route-area="OrchardCore.Placements" asp-route-shapeType="@Model.ShapeType" asp-route-returnUrl="@FullRequestPath" class="btn btn-primary btn-sm" role="button">@T["Edit"]</a> | ||
<a asp-route-action="Delete" asp-route-area="OrchardCore.Placements" asp-route-shapeType="@Model.ShapeType" class="btn btn-danger btn-sm" role="button" itemprop="UnsafeUrl RemoveUrl">@T["Delete"]</a> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't edit this repo, so can you add the newline here please
</div> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't edit this repo, so can you add the newline here too please
src/OrchardCore.Modules/OrchardCore.Placements/Views/Admin/Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Placements/Views/Admin/Index.cshtml
Outdated
Show resolved
Hide resolved
@ns8482e I'm not sure how this would benefit from a core, or abstractions project? It uses the extension interface already added by @TFleury from The abstractions and core projects are by and large more about other modules being able to safely reference each other. I can't think what you would put from this in a core or abstractions projects, for any real benefit to another module? Maybe I am wrong? |
@deanmarcussen I mean this feature can be used in I mean UI and CRUD will still be in the CMS module, However moving |
7c10509
to
73a0853
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @TFleury I didn't see you had updated this a while back.
src/OrchardCore.Modules/OrchardCore.Placements/Views/Admin/Edit.cshtml
Outdated
Show resolved
Hide resolved
@TFleury As it is a new module, can you please add the bare minimum docs: A specific folder and readme file in the src/docs/reference with a description of the module and add it to the TOC in mkdocs.yml. |
Asking again: Can you please add some docs @TFleury before we can merge it? |
@agriffard thanks for the reminder, I just added it. |
Thank you. 162nd OC project. 👏 |
@TFleury Could be nice if placement docs would be updated :D I think that I tried every possible combination.. maybe it just does not work on custom parts? Imho it is needed to allow placement of custom parts defined in admin, also it would be great if differentiator would work only by fieldname without contentpart prefix |
related maybe #7952 |
I had the exact same issue as MikeKry |
Fixes #6503
The Placements module add an optional feature that lets user define custom placements rules in admin UI.
This PR is a rewrite of #6595, it uses
IShapePlacementProvider
introduced by #6780 to provide placements at runtime.Captures :
Shortcuts zone :