-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue/TDEAL-16' of https://github.com/Lombiq/Helpful-Li…
…braries into issue/TDEAL-16
- Loading branch information
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
Lombiq.HelpfulLibraries.OrchardCore/Contents/ContentFieldEditorEnums.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,46 @@ | ||
using System.ComponentModel; | ||
|
||
namespace Lombiq.HelpfulLibraries.OrchardCore.Contents; | ||
|
||
/// <summary> | ||
/// Collection of different ContentField editors. | ||
/// Feel free to extend this class by adding more Enum classes with ContentField editors. | ||
/// </summary> | ||
public static class ContentFieldEditorEnums | ||
{ | ||
[Description("Editor options for HtmlFields.")] | ||
public enum HtmlFieldEditors | ||
{ | ||
Monaco, | ||
Multiline, | ||
Trumbowyg, | ||
Wysiwyg, | ||
} | ||
|
||
[Description("Editor options for MarkdownFields. Wysiwyg editor can be used for MarkdownBodyParts as well.")] | ||
public enum MarkdownFieldEditors | ||
{ | ||
TextArea, | ||
Wysiwyg, | ||
} | ||
|
||
[Description("Editor options for TaxonomyFields.")] | ||
public enum TaxonomyFieldEditors | ||
{ | ||
Tags, | ||
} | ||
|
||
[Description("Editor options for TextFields.")] | ||
public enum TextFieldEditors | ||
{ | ||
CodeMirror, | ||
Color, | ||
Email, | ||
IconPicker, | ||
Monaco, | ||
PredefinedList, | ||
Tel, | ||
TextArea, | ||
Url, | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
Lombiq.HelpfulLibraries.OrchardCore/Contents/ContentTypePartDefinitionBuilderExtensions.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,13 @@ | ||
using OrchardCore.ContentManagement.Metadata.Builders; | ||
using System; | ||
|
||
namespace OrchardCore.ContentManagement.Metadata.Settings; | ||
|
||
public static class ContentTypePartDefinitionBuilderExtensions | ||
{ | ||
/// <summary> | ||
/// Sets the part's editor using an <see cref="Enum"/> parameter. | ||
/// </summary> | ||
public static ContentTypePartDefinitionBuilder WithEditor(this ContentTypePartDefinitionBuilder builder, Enum editor) => | ||
builder.MergeSettings<ContentTypePartSettings>(x => x.Editor = editor.ToString()); | ||
} |
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