|
1 | 1 | @model BlogPostModel
|
2 | 2 | @using SmartStore.Web.Models.Blogs;
|
| 3 | +@using SmartStore.Core.Domain.Seo; |
3 | 4 | @{
|
4 | 5 | Layout = "_Layout";
|
5 | 6 |
|
6 | 7 | Html.AddTitleParts(Model.MetaTitle.HasValue() ? Model.MetaTitle : Model.Title);
|
7 | 8 | Html.AddMetaDescriptionParts(Model.MetaDescription);
|
8 | 9 | Html.AddMetaKeywordParts(Model.MetaKeywords);
|
| 10 | + |
| 11 | + var blogPostUrl = Url.RouteUrl("BlogPost", new { SeName = Model.SeName }, this.Request.Url.Scheme); |
| 12 | + var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled; |
| 13 | + if (canonicalUrlsEnabled) |
| 14 | + { |
| 15 | + Html.AddCanonicalUrlParts(blogPostUrl); |
| 16 | + } |
9 | 17 | }
|
10 | 18 |
|
11 | 19 | @{ Html.RenderAction("MetaPropertiesBlog", "Common", new { blogPost = Model }); }
|
12 | 20 |
|
13 | 21 | @section right {
|
14 | 22 | @{
|
15 | 23 | Html.RenderAction("BlogMonths", "Blog");
|
16 |
| - Html.RenderWidget("blog_right_months_after"); |
| 24 | + Html.RenderWidget("blog_right_months_after"); |
17 | 25 | Html.RenderAction("BlogTags", "Blog");
|
18 |
| - Html.RenderWidget("blog_right_bottom"); |
| 26 | + Html.RenderWidget("blog_right_bottom"); |
19 | 27 | }
|
20 | 28 | }
|
21 | 29 |
|
22 | 30 | <article class="page blogpost-page" itemprop="mainEntity" itemscope itemtype="http://schema.org/BlogPosting">
|
23 | 31 |
|
24 | 32 | @if (Model.DisplayAdminLink)
|
25 |
| - { |
26 |
| - <a class="btn btn-secondary btn-flat btn-admin-edit" href="@Url.Action("Edit", "Blog", new { id = Model.Id, area = "admin" })" target="admin-blogpost" rel="nofollow"> |
27 |
| - <i class="fa fa-cog"></i> |
28 |
| - <span>@T("Common.Cms.EditBlogpost")</span> |
29 |
| - </a> |
30 |
| - } |
| 33 | + { |
| 34 | + <a class="btn btn-secondary btn-flat btn-admin-edit" href="@Url.Action("Edit", "Blog", new { id = Model.Id, area = "admin" })" target="admin-blogpost" rel="nofollow"> |
| 35 | + <i class="fa fa-cog"></i> |
| 36 | + <span>@T("Common.Cms.EditBlogpost")</span> |
| 37 | + </a> |
| 38 | + } |
31 | 39 |
|
32 | 40 | @if (Model.PictureModel.FullSizeImageUrl.HasValue())
|
33 | 41 | {
|
|
48 | 56 | <meta itemprop="url" content="@Request.Url.AbsoluteUri" />
|
49 | 57 |
|
50 | 58 | <div class="page-title mb-4 mt-3">
|
51 |
| - <h1 class="fs-h2" itemprop="headline">@Model.Title</h1> |
| 59 | + <h1 class="fs-h2" itemprop="headline">@Model.Title</h1> |
52 | 60 | </div>
|
53 | 61 |
|
54 | 62 | <div class="blogpost-body">
|
55 |
| - |
| 63 | + |
56 | 64 | @{ Html.RenderWidget("blogpost_page_before_body"); }
|
57 | 65 |
|
58 | 66 | <div class="blogpost-content long-text html-editor-content" itemprop="articleBody">
|
|
73 | 81 | <meta itemprop="articleSection" content="@keywords" />
|
74 | 82 | <meta itemprop="keywords" content="@keywords" />
|
75 | 83 |
|
76 |
| - } |
77 |
| - |
78 |
| - @{ Html.RenderWidget("blogpost_page_before_comments"); } |
79 |
| - |
80 |
| - @if (Model.Comments.AllowComments) |
81 |
| - { |
82 |
| - <div class="row"> |
83 |
| - <div class="col-12"> |
84 |
| - <div class="block blog-comment-form mt-5"> |
85 |
| - @using (Html.BeginForm()) |
86 |
| - { |
87 |
| - <fieldset class="blog-comment-form content-group mt-5"> |
88 |
| - <legend><span>@T("Blog.Comments.LeaveYourComment")</span></legend> |
89 |
| - |
90 |
| - @if (ViewContext.ViewData.ModelState.ContainsKey("")) |
91 |
| - { |
92 |
| - @Html.ValidationSummary(true) |
93 |
| - } |
94 |
| - |
95 |
| - @if (this.EnableHoneypotProtection) |
96 |
| - { |
97 |
| - <div class="d-none"> |
98 |
| - @Html.HoneypotField() |
99 |
| - </div> |
100 |
| - } |
101 |
| - |
102 |
| - <div class="form-group"> |
103 |
| - @Html.TextAreaFor(model => model.AddNewComment.CommentText, new { @class = "form-control form-control-lg", placeholder = Html.DisplayNameFor(m => m.AddNewComment.CommentText), rows = "6" }) |
104 |
| - @Html.ValidationMessageFor(model => model.AddNewComment.CommentText) |
105 |
| - </div> |
106 |
| - |
107 |
| - @{ Html.RenderWidget("gdpr_consent"); } |
108 |
| - |
109 |
| - @if (Model.AddNewComment.DisplayCaptcha) |
110 |
| - { |
111 |
| - <div class="form-group"> |
112 |
| - <div class="captcha-box"> |
113 |
| - @Html.Raw(Html.GenerateCaptcha()) |
114 |
| - </div> |
115 |
| - </div> |
116 |
| - } |
117 |
| - |
118 |
| - <div class="form-group"> |
119 |
| - <button type="submit" name="add-comment" value="add-comment" class="btn btn-primary btn-lg"> |
120 |
| - @T("Blog.Comments.SubmitButton") |
121 |
| - </button> |
122 |
| - </div> |
123 |
| - </fieldset> |
124 |
| - } |
125 |
| - </div> |
126 |
| - |
127 |
| - @{ Html.RenderPartial("Comment.List", Model.Comments); } |
128 |
| - </div> |
129 |
| - </div> |
130 |
| - } |
131 |
| - |
132 |
| - @{ Html.RenderWidget("blogpost_page_after_comments"); } |
| 84 | + } |
| 85 | + |
| 86 | + @{ Html.RenderWidget("blogpost_page_before_comments"); } |
| 87 | + |
| 88 | + @if (Model.Comments.AllowComments) |
| 89 | + { |
| 90 | + <div class="row"> |
| 91 | + <div class="col-12"> |
| 92 | + <div class="block blog-comment-form mt-5"> |
| 93 | + @using (Html.BeginForm()) |
| 94 | + { |
| 95 | + <fieldset class="blog-comment-form content-group mt-5"> |
| 96 | + <legend><span>@T("Blog.Comments.LeaveYourComment")</span></legend> |
| 97 | + |
| 98 | + @if (ViewContext.ViewData.ModelState.ContainsKey("")) |
| 99 | + { |
| 100 | + @Html.ValidationSummary(true) |
| 101 | + } |
| 102 | + |
| 103 | + @if (this.EnableHoneypotProtection) |
| 104 | + { |
| 105 | + <div class="d-none"> |
| 106 | + @Html.HoneypotField() |
| 107 | + </div> |
| 108 | + } |
| 109 | + |
| 110 | + <div class="form-group"> |
| 111 | + @Html.TextAreaFor(model => model.AddNewComment.CommentText, new { @class = "form-control form-control-lg", placeholder = Html.DisplayNameFor(m => m.AddNewComment.CommentText), rows = "6" }) |
| 112 | + @Html.ValidationMessageFor(model => model.AddNewComment.CommentText) |
| 113 | + </div> |
| 114 | + |
| 115 | + @{ Html.RenderWidget("gdpr_consent"); } |
| 116 | + |
| 117 | + @if (Model.AddNewComment.DisplayCaptcha) |
| 118 | + { |
| 119 | + <div class="form-group"> |
| 120 | + <div class="captcha-box"> |
| 121 | + @Html.Raw(Html.GenerateCaptcha()) |
| 122 | + </div> |
| 123 | + </div> |
| 124 | + } |
| 125 | + |
| 126 | + <div class="form-group"> |
| 127 | + <button type="submit" name="add-comment" value="add-comment" class="btn btn-primary btn-lg"> |
| 128 | + @T("Blog.Comments.SubmitButton") |
| 129 | + </button> |
| 130 | + </div> |
| 131 | + </fieldset> |
| 132 | + } |
| 133 | + </div> |
| 134 | + |
| 135 | + @{ Html.RenderPartial("Comment.List", Model.Comments); } |
| 136 | + </div> |
| 137 | + </div> |
| 138 | + } |
| 139 | + |
| 140 | + @{ Html.RenderWidget("blogpost_page_after_comments"); } |
133 | 141 | </div>
|
134 | 142 | </article>
|
0 commit comments