Skip to content

Commit

Permalink
FEATURE ElementBlogPosts template Boostrap updates (#46)
Browse files Browse the repository at this point in the history
move post summary to include
  • Loading branch information
jsirish authored Sep 13, 2023
1 parent 39005ac commit 8914244
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
28 changes: 10 additions & 18 deletions templates/Dynamic/Elements/Blog/Elements/ElementBlogPosts.ss
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,19 @@
<% if $Content %><div class="element__content">$Content</div><% end_if %>

<% if $PostsList %>
<div class="row">
<div class="row element__blog__list">
<% loop $PostsList %>
<div class="col-md-4 card">
<img src="$FeaturedImage.URL" class="card-img-top">
<div class="card-body">
<h3 class="card-title">
<a href="$Link.ATT" title="Go to the $Title post">
$Title
</a>
</h3>
<% include SilverStripe\\Blog\\EntryMeta %>
<div class="card-text">
$Summary
</div>
<a href="$Link.ATT" class="btn btn-primary">Read more</a>
</div>
</div>
<% include ElementBlogSummary %>
<% end_loop %>
<p><a href="$Blog.Link" class="btn btn-primary" title="Go to the $Title page">View all posts</a></p>
</div>

<div class="row mb-3">
<div class="col-md-12 text-center">
<p>
<a href="$Blog.Link" class="btn btn-primary" title="View all $Title posts">
View all posts
</a>
</p>
</div>
<% else %>
<p>No recent posts.</p>
<% end_if %>
15 changes: 15 additions & 0 deletions templates/Includes/ElementBlogSummary.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="col-lg-4 col-md-6 col-sm-12 mb-3 element__promos__item">
<div class="card h-100">
<% if $FeaturedImage %>
<a href="$Link" title="Read $MenuTitle.ATT">
<img src="$FeaturedImage.FocusFill(500,330).URL" class="card-img-top" alt="$Image.Title.ATT">
</a>
<% end_if %>
<div class="card-body">
<h3 class="card-title">$Title</a></h3>
<% include SilverStripe\\Blog\\EntryMeta %>
<% if $Summary %><div class="card-text">$Summary</div><% end_if %>
<p><a href="$Link.ATT" class="btn btn-outline-primary">Read more</a></p>
</div>
</div>
</div>

0 comments on commit 8914244

Please sign in to comment.