mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
added templates to blog module
This commit is contained in:
parent
c4c3c3c010
commit
8e8dea0ff5
3
css/blog.css
Normal file
3
css/blog.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.no-sidebar .content-container.size3of4 {
|
||||||
|
width: 75%;
|
||||||
|
}
|
17
templates/Includes/BlogPostSummary.ss
Normal file
17
templates/Includes/BlogPostSummary.ss
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<div class="post-summary">
|
||||||
|
<% if $FeaturedImage %>
|
||||||
|
<p class="post-image"><a href="$Link">
|
||||||
|
$FeaturedImage.setWidth(795)
|
||||||
|
</a></p>
|
||||||
|
<% end_if %>
|
||||||
|
<h2><a href="$Link">$Title</a></h2>
|
||||||
|
<p>$Content.Summary(30,0)</p>
|
||||||
|
<div class="post-controls">
|
||||||
|
<p class="post-stats">
|
||||||
|
<%t Blog.Posted 'Posted' %> $PublishDate.Ago
|
||||||
|
| <%t Blog.Tags 'Tags' %>: <% loop $Tags %><a href="$Link">$Title</a><%if not $Last%>,<% end_if %> <% end_loop %>
|
||||||
|
| <%t Blog.Categories 'Categories' %>: <% loop $Categories %><a href="$Link">$Title</a><%if not $Last%>,<% end_if %> <% end_loop %>
|
||||||
|
</p>
|
||||||
|
<p><a href="$Link"><%t Blog.ReadMore 'Read More' %> ></a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
5
templates/Includes/BlogSidebar.ss
Normal file
5
templates/Includes/BlogSidebar.ss
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<div class="typography unit size1of4 lastUnit">
|
||||||
|
<% if SideBarView %>
|
||||||
|
$SideBarView
|
||||||
|
<% end_if %>
|
||||||
|
</div>
|
25
templates/Includes/Pagination.ss
Normal file
25
templates/Includes/Pagination.ss
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<%-- NOTE: Before including this, you will need to wrap the include in a with block --%>
|
||||||
|
|
||||||
|
<% if $MoreThanOnePage %>
|
||||||
|
<p class="pagination">
|
||||||
|
<% if $NotFirstPage %>
|
||||||
|
<a class="prev" href="{$PrevLink}">←</a>
|
||||||
|
<% end_if %>
|
||||||
|
|
||||||
|
<% loop $Pages %>
|
||||||
|
<% if $CurrentBool %>
|
||||||
|
<span>$PageNum</span>
|
||||||
|
<% else %>
|
||||||
|
<% if $Link %>
|
||||||
|
<a href="$Link">$PageNum</a>
|
||||||
|
<% else %>
|
||||||
|
<span>...</span>
|
||||||
|
<% end_if %>
|
||||||
|
<% end_if %>
|
||||||
|
<% end_loop %>
|
||||||
|
|
||||||
|
<% if $NotLastPage %>
|
||||||
|
<a class="next" href="{$NextLink}">→</a>
|
||||||
|
<% end_if %>
|
||||||
|
</p>
|
||||||
|
<% end_if %>
|
17
templates/Layout/Blog.ss
Normal file
17
templates/Layout/Blog.ss
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<% require css(blog/css/blog.css) %>
|
||||||
|
|
||||||
|
<div class="content-container <% if SideBarView %>unit size3of4<% end_if %>">
|
||||||
|
<article>
|
||||||
|
<h1>$Title</h1>
|
||||||
|
<div class="content">$Content</div>
|
||||||
|
<% loop $PaginatedList %>
|
||||||
|
<% include BlogPostSummary %>
|
||||||
|
<% end_loop %>
|
||||||
|
</article>
|
||||||
|
$Form
|
||||||
|
$PageComments
|
||||||
|
<% with $PaginatedList %>
|
||||||
|
<% include Pagination %>
|
||||||
|
<% end_with %>
|
||||||
|
</div>
|
||||||
|
<% if SideBarView %><% include BlogSidebar %><% end_if %>
|
17
templates/Layout/BlogPost.ss
Normal file
17
templates/Layout/BlogPost.ss
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<div class="content-container <% if $Menu(2) || SideBarView %>unit size3of4<% end_if %>">
|
||||||
|
<article>
|
||||||
|
<h1>$Title</h1>
|
||||||
|
<% if $FeaturedImage %>
|
||||||
|
<p>$FeaturedImage.setWidth(795)</p>
|
||||||
|
<% end_if %>
|
||||||
|
<div class="content">$Content</div>
|
||||||
|
<p class="post-stats">
|
||||||
|
<%t Blog.Posted 'Posted' %> $PublishDate.Ago
|
||||||
|
| <%t Blog.Tags 'Tags' %>: <% loop $Tags %><a href="$Link">$Title</a><%if not $Last%>,<% end_if %> <% end_loop %>
|
||||||
|
| <%t Blog.Categories 'Categories' %>: <% loop $Categories %><a href="$Link">$Title</a><%if not $Last%>,<% end_if %> <% end_loop %>
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
$Form
|
||||||
|
$PageComments
|
||||||
|
</div>
|
||||||
|
<% include BlogSidebar %>
|
Loading…
Reference in New Issue
Block a user