Skip to content

Commit

Permalink
Add AsWidget extension method.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Nov 24, 2023
1 parent d087f5b commit 2dcd2be
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Lombiq.HelpfulLibraries.OrchardCore.Contents;
using OrchardCore.Autoroute.Models;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Title.Models;
Expand Down Expand Up @@ -66,4 +67,11 @@ public static ContentTypeDefinitionBuilder WithContentTypeAutoroute(
AllowUpdatePath = true,
ManageContainedItemRoutes = true,
}));

/// <summary>
/// Sets the type's <see cref="ContentTypeSettings.Stereotype"/> to <see cref="CommonStereotypes.Widget"/>.
/// accordingly.
/// </summary>
public static ContentTypeDefinitionBuilder AsWidget(this ContentTypeDefinitionBuilder builder) =>
builder.Stereotype(CommonStereotypes.Widget);
}

0 comments on commit 2dcd2be

Please sign in to comment.