-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_Details.cshtml
53 lines (41 loc) · 1.5 KB
/
_Details.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@inherits ToSic.Sxc.Dnn.RazorComponent
@using ToSic.Razor.Blade;
@Html.Partial("./shared/_Assets.cshtml", new { scripts = true} )
@{
var parts = CreateInstance("./shared/_Parts.cshtml");
var article = AsList(Data).FirstOrDefault();
var filteredCategory = Request.QueryString["category"];
var categoryParams = Text.Has(filteredCategory)
? "category=" + filteredCategory
: "";
@* Show article not found notification and stop processing *@
if(article == null) {
@parts.ArticleNotFound()
@* Show "Back to list" button *@
@parts.BackToListButton(categoryParams)
return;
}
Kit.Page.AddMeta("description", Kit.Scrub.All(article.Teaser));
Kit.Page.SetTitle(article.Date.ToString("d") + " - " + article.Title);
}
<div class="app-news5 app-news5-detail" @Edit.TagToolbar(article)>
@* Head of the article *@
<div class="app-news5-content">
@* "Will publish"/"expired" notes for admin *@
@parts.ArticleInformationAdmin(article)
<h2>@article.Title</h2>
@* Show Date and categories *@
@parts.ArticleInformationDateAndCategories(article)
</div>
@* Body of the article *@
<div class="app-news5-content">
@* Show image or placeholder *@
@parts.ImageOrPlaceholder(article, true)
@if(article.ShowTeaserInDetail) {
<p class="app-news5-detail-teaser">@Html.Raw(Tags.Nl2Br(article.Teaser))</p>
}
<div class="app-news5-detail-body">@Html.Raw(article.Body)</div>
</div>
</div>
@* Show "Back to list" button *@
@parts.BackToListButton(categoryParams)