Browse Source

CmsKit - Add blog title to dummy image temporarily

pull/8028/head
enisn 5 years ago
parent
commit
c55ac614b0
  1. 10
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Blogs/BlogPost/Default.cshtml
  2. 4
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml

10
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Blogs/BlogPost/Default.cshtml

@ -5,12 +5,12 @@
@inject IStringLocalizer<CmsKitResource> L
@{
const string dummyImageSource = "https://dummyimage.com/300x200/a3a3a3/fff.png";
string dummyImageSource = "https://dummyimage.com/1280x720/a3a3a3/fff.png?text=" + Model.Title;
}
<abp-card>
<img src="/api/cms-kit/media/@Model.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" />
<abp-card-body>
<abp-card-body>
<abp-row>
<div class="col-lg-8 col-md-10 mx-auto pb-4">
<h1 class="mt-lg-4 mt-md-3">@Model.Title</h1>
@ -18,14 +18,14 @@
<span class="font-weight-bold">@@@Model.Author?.UserName</span>
<small style="opacity:.65;">@Model.CreationTime</small>
</p>
@Html.Raw(Model.Content)
@Html.Raw(Model.Content)
<p>
@if (Model.LastModificationTime != null)
{
<small style="opacity:.65;">@L["LastModification"].Value : @Model.LastModificationTime</small>
<small style="opacity:.65;">@L["LastModification"].Value : @Model.LastModificationTime</small>
}
</p>
</div>
</abp-row>
</abp-card-body>
</abp-card-body>
</abp-card>

4
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml

@ -8,7 +8,7 @@
@model IndexModel
@{
const string dummyImageSource = "https://dummyimage.com/300x200/a3a3a3/fff.png";
const string dummyImageSource = "https://dummyimage.com/320x180/a3a3a3/fff.png";
}
<abp-row id="blogs-container">
@ -22,7 +22,7 @@
}
else
{
<img src="@dummyImageSource" class="card-img-top" />
<img src="@(dummyImageSource)?text=@blog.Title" class="card-img-top" />
}
<abp-card-body class="p-4">
<h5>@blog.Title</h5>

Loading…
Cancel
Save