-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement using new ASP.NET Core SDK (#479)
Co-authored-by: Ivan Lieckens <[email protected]>
- Loading branch information
1 parent
652fde3
commit 048860d
Showing
110 changed files
with
305 additions
and
324 deletions.
There are no files selected for viewing
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
4 changes: 2 additions & 2 deletions
4
src/Feature/BasicContent/rendering/Extensions/RenderingEngineOptionsExtensions.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class AnnouncementBar | ||
{ | ||
public RichTextField AnnouncementText { get; set; } | ||
public HyperLinkField AnnouncementLink { get; set; } | ||
public RichTextField? AnnouncementText { get; set; } | ||
public HyperLinkField? AnnouncementLink { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,48 +1,46 @@ | ||
using Sitecore.AspNet.RenderingEngine.Binding; | ||
using Sitecore.AspNet.RenderingEngine.Binding.Attributes; | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using Sitecore.AspNetCore.SDK.RenderingEngine.Binding.Attributes; | ||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class ContentList | ||
{ | ||
[SitecoreComponentField(Name = "ContentListTitle")] | ||
public TextField Title { get; set; } | ||
public TextField? Title { get; set; } | ||
|
||
[SitecoreComponentField(Name = "Selected Items")] | ||
public ContentListItem[] Items { get; set; } | ||
public ContentListItem[]? Items { get; set; } | ||
|
||
[SitecoreComponentProperty()] | ||
public ItemLinkField ContentListType { get; set; } | ||
[SitecoreComponentProperty] | ||
public ItemLinkField? ContentListType { get; set; } | ||
|
||
[SitecoreComponentField] | ||
public NumberField ContentListLimit { get; set; } | ||
public NumberField? ContentListLimit { get; set; } | ||
} | ||
|
||
public class ContentListItem | ||
{ | ||
public string Url { get; set; } | ||
public string Name { get; set; } | ||
public string Id { get; set; } | ||
public string DisplayName { get; set; } | ||
public string? Url { get; set; } | ||
public string? Name { get; set; } | ||
public string? Id { get; set; } | ||
public string? DisplayName { get; set; } | ||
|
||
[SitecoreComponentField] | ||
|
||
public ContentListItemFields Fields { get; set; } | ||
public ContentListItemFields? Fields { get; set; } | ||
} | ||
|
||
public class ContentListItemFields | ||
{ | ||
[SitecoreComponentField] | ||
public TextField ItemTitle { get; set; } | ||
public TextField? ItemTitle { get; set; } | ||
|
||
[SitecoreComponentField] | ||
public TextField ItemSubtitle { get; set; } | ||
public TextField? ItemSubtitle { get; set; } | ||
|
||
[SitecoreComponentField] | ||
public TextField ItemText { get; set; } | ||
public TextField? ItemText { get; set; } | ||
|
||
[SitecoreComponentField] | ||
public HyperLinkField ItemLink { get; set; } | ||
public HyperLinkField? ItemLink { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class CtaContent | ||
{ | ||
public TextField CtaTitle { get; set; } | ||
public RichTextField CtaText { get; set; } | ||
public HyperLinkField CtaLink { get; set; } | ||
public ImageField CtaImage{ get; set; } | ||
public TextField? CtaTitle { get; set; } | ||
|
||
public RichTextField? CtaText { get; set; } | ||
|
||
public HyperLinkField? CtaLink { get; set; } | ||
|
||
public ImageField? CtaImage{ get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class EmbedContent | ||
{ | ||
public TextField EmbedCode { get; set; } | ||
public TextField? EmbedCode { get; set; } | ||
} | ||
} |
11 changes: 2 additions & 9 deletions
11
src/Feature/BasicContent/rendering/Models/HalfWidthBanner.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 |
---|---|---|
@@ -1,11 +1,4 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class HalfWidthBanner : CtaContent | ||
{ | ||
|
||
} | ||
public class HalfWidthBanner : CtaContent; | ||
} |
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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class HeroBase | ||
{ | ||
public TextField HeroTitle { get; set; } | ||
public TextField HeroSubtitle { get; set; } | ||
public TextField HeroDescription { get; set; } | ||
public HyperLinkField HeroLink { get; set; } | ||
public ImageField HeroImage { get; set; } | ||
public TextField? HeroTitle { get; set; } | ||
|
||
public TextField? HeroSubtitle { get; set; } | ||
|
||
public TextField? HeroDescription { get; set; } | ||
|
||
public HyperLinkField? HeroLink { get; set; } | ||
|
||
public ImageField? HeroImage { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class HeroBig : HeroBase | ||
{ | ||
} | ||
public class HeroBig : HeroBase; | ||
} |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class HeroMedium : HeroBase | ||
{ | ||
} | ||
public class HeroMedium : HeroBase; | ||
} |
4 changes: 1 addition & 3 deletions
4
src/Feature/BasicContent/rendering/Models/HeroMediumWithLink.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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class HeroMediumWithLink : HeroBase | ||
{ | ||
} | ||
public class HeroMediumWithLink : HeroBase; | ||
} |
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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class ImageTeaser | ||
{ | ||
public TextField TeaserTitle { get; set; } | ||
public RichTextField TeaserText { get; set; } | ||
public HyperLinkField TeaserLink { get; set; } | ||
public ImageField TeaserImage { get; set; } | ||
public TextField? TeaserTitle { get; set; } | ||
|
||
public RichTextField? TeaserText { get; set; } | ||
|
||
public HyperLinkField? TeaserLink { get; set; } | ||
|
||
public ImageField? TeaserImage { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class RichTextContent | ||
{ | ||
public RichTextField Content { get; set; } | ||
public RichTextField? Content { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
using Sitecore.LayoutService.Client.Response.Model.Fields; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; | ||
|
||
namespace Mvp.Feature.BasicContent.Models | ||
{ | ||
public class VideoTeaser | ||
{ | ||
public TextField TeaserTitle { get; set; } | ||
public RichTextField TeaserText { get; set; } | ||
public HyperLinkField TeaserLink { get; set; } | ||
public TextField TeaserEmbed { get; set; } | ||
public TextField? TeaserTitle { get; set; } | ||
|
||
public RichTextField? TeaserText { get; set; } | ||
|
||
public HyperLinkField? TeaserLink { get; set; } | ||
|
||
public TextField? TeaserEmbed { get; set; } | ||
} | ||
} |
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
34 changes: 11 additions & 23 deletions
34
...ature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ContentList.cshtml
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 |
---|---|---|
@@ -1,44 +1,32 @@ | ||
@model Mvp.Feature.BasicContent.Models.ContentList | ||
@using Mvp.Feature.BasicContent.Models | ||
@model Mvp.Feature.BasicContent.Models.ContentList | ||
|
||
|
||
@if (!string.IsNullOrEmpty(Model.Title.Value)) | ||
@if (!string.IsNullOrEmpty(Model.Title?.Value)) | ||
{ | ||
<div class="col-12 col-lg-12 text-center"> | ||
<h2 asp-for="@Model.Title"></h2> | ||
</div> | ||
} | ||
|
||
@{ | ||
var fileName = string.Empty; | ||
string fileName = string.Empty; | ||
|
||
switch (Model.ContentListType.Id) | ||
switch (Model.ContentListType?.Id) | ||
{ | ||
case var id when(id == new Guid("E58A021E-74D2-471E-9EBA-B09616350605")): // White blocks | ||
case var id when id == new Guid("E58A021E-74D2-471E-9EBA-B09616350605"): // White blocks | ||
fileName = "_clFeatureBlock.cshtml"; | ||
break; | ||
case var id when(id == new Guid("92DD658A-76BE-437A-86E4-589DF627FBCC")): // MVP 3 columns | ||
case var id when id == new Guid("92DD658A-76BE-437A-86E4-589DF627FBCC"): // MVP 3 columns | ||
fileName = "_clMvpYearBlockThreeColumn.cshtml"; | ||
break; | ||
case var id when(id == new Guid("F0027CB2-8725-48EA-B85D-EB83E5216E5A")): // MVP 4 columns | ||
case var id when id == new Guid("F0027CB2-8725-48EA-B85D-EB83E5216E5A"): // MVP 4 columns | ||
fileName = "_clMvpYearBlockFourColumn.cshtml"; | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
@*@if (Model.ContentListLimit.Value > 0) | ||
@foreach (ContentListItem item in Model.Items ?? []) | ||
{ | ||
@foreach (var item in Model.Items.Take(Model.ContentListLimit.Value.Value as int)) | ||
{ | ||
@await Html.PartialAsync(fileName, item) | ||
} | ||
} | ||
else | ||
{*@ | ||
@foreach (var item in Model.Items) | ||
{ | ||
@await Html.PartialAsync(fileName, item) | ||
} | ||
@*}*@ | ||
@await Html.PartialAsync(fileName, item) | ||
} |
2 changes: 1 addition & 1 deletion
2
...ture/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/EmbedContent.cshtml
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@model Mvp.Feature.BasicContent.Models.EmbedContent | ||
|
||
<div class="embed"> | ||
@Html.Raw(Model.EmbedCode.Value) | ||
@Html.Raw(Model.EmbedCode?.Value) | ||
</div> |
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
Oops, something went wrong.