forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Input Widget css style and add alternate for Widget-Forms to allo…
…w customization (OrchardCMS#15563) Co-authored-by: Zoltán Lehóczky <[email protected]>
- Loading branch information
1 parent
5b91276
commit e151098
Showing
7 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/OrchardCore.Modules/OrchardCore.Forms/FormShapeTableProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using OrchardCore.ContentManagement; | ||
using OrchardCore.DisplayManagement; | ||
using OrchardCore.DisplayManagement.Descriptors; | ||
using OrchardCore.DisplayManagement.Utilities; | ||
using OrchardCore.Forms.Models; | ||
|
||
namespace OrchardCore.Forms; | ||
|
||
public class FormShapeTableProvider : IShapeTableProvider | ||
{ | ||
public void Discover(ShapeTableBuilder builder) | ||
{ | ||
builder.Describe("Widget__Form") | ||
.OnDisplaying(context => | ||
{ | ||
if (context.Shape.TryGetProperty<ContentItem>("ContentItem", out var contentItem) | ||
&& contentItem.TryGet<FormElementPart>(out var elementPart) | ||
&& !string.IsNullOrEmpty(elementPart.Id)) | ||
{ | ||
context.Shape.Metadata.Alternates.Add($"Widget__{contentItem.ContentType}_{elementPart.Id.EncodeAlternateElement()}"); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters