Skip to content

Commit b40286d

Browse files
committed
Updated to CF 0.9
1 parent 02e38f8 commit b40286d

File tree

6 files changed

+63
-3
lines changed

6 files changed

+63
-3
lines changed

src/Cofoundry.Plugins.SiteMap/Cofoundry.Plugins.SiteMap.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</ItemGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="Cofoundry.Domain" Version="0.8.0" />
26+
<PackageReference Include="Cofoundry.Domain" Version="0.9.0" />
2727
</ItemGroup>
2828

2929
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Cofoundry.Domain;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
namespace SitemapExample
8+
{
9+
public class ProductPageDisplayModel : ICustomEntityPageDisplayModel<ProductDataModel>
10+
{
11+
public string PageTitle { get; set; }
12+
13+
public string MetaDescription { get; set; }
14+
15+
public string ShortDescription { get; set; }
16+
}
17+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Cofoundry.Domain;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
namespace SitemapExample
8+
{
9+
public class ProductPageDisplayModelMapper : ICustomEntityDisplayModelMapper<ProductDataModel, ProductPageDisplayModel>
10+
{
11+
public Task<ProductPageDisplayModel> MapDisplayModelAsync(
12+
CustomEntityRenderDetails renderDetails,
13+
ProductDataModel dataModel,
14+
PublishStatusQuery publishStatusQuery
15+
)
16+
{
17+
var displayModel = new ProductPageDisplayModel()
18+
{
19+
PageTitle = renderDetails.Title,
20+
MetaDescription = dataModel.ShortDescription,
21+
ShortDescription = dataModel.ShortDescription
22+
};
23+
24+
return Task.FromResult(displayModel);
25+
}
26+
}
27+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@model ICustomEntityPageViewModel<ProductPageDisplayModel>
2+
@inject ICofoundryTemplateHelper<ICustomEntityPageViewModel<ProductPageDisplayModel>> Cofoundry
3+
4+
@Cofoundry.Template.UseDescription("A template for products")
5+
6+
<h1>@Model.PageTitle</h1>
7+
<p>
8+
@Model.CustomEntity.Model.ShortDescription
9+
</p>
10+
<div>
11+
@(await Cofoundry.Template.Region("Body")
12+
.AllowMultipleBlocks()
13+
.AllowBlockType<PlainTextDataModel>()
14+
.EmptyContentMinHeight(500)
15+
.InvokeAsync())
16+
</div>

src/SitemapExample/SitemapExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Cofoundry.Web.Admin" Version="0.8.0" />
10+
<PackageReference Include="Cofoundry.Web.Admin" Version="0.9.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/SitemapExample/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
},
88

99
"Cofoundry": {
10-
"Database:ConnectionString": "Server=.\\sqlexpress;Database=SitemapExample;Integrated Security=True;MultipleActiveResultSets=True"
10+
"Database:ConnectionString": "Server=.\\sqlexpress;Database=Cofoundry.SitemapExample;Integrated Security=True;MultipleActiveResultSets=True"
1111
}
1212
}

0 commit comments

Comments
 (0)