I think you're pretty busy with the PHP back-end, so if you don't mind I'll make suggestions for the HTML and Less front-end.
For the template
taylorj_blogs_blog_view
it would be wise to use the “
cell” message structure, this allows for XF consistency.
View attachment 308462
View attachment 308464
HTML:
<xf:css src="taylorj_blogs_blog_view.less" />
<xf:breadcrumb source="$blog.getBreadcrumbs(true)" />
<xf:title>{$blog.blog_title}</xf:title>
<xf:description>{$blog.blog_description}</xf:description>
<div class="taylorjUserBlogs-blog-description">
<xf:pageaction>
<xf:button href="{{ link('blogs/blog/add-post', $blog) }}" fa="fa-plus-square" class="button--cta">
Create a new post
</xf:button>
</xf:pageaction>
<xf:if contentcheck="true">
<div class="u-pullRight buttonGroup-buttonWrapper">
<xf:button class="button--link menuTrigger" data-xf-click="menu" aria-expanded="false" aria-haspopup="true"
title="{{ phrase('more_options') }}">•••</xf:button>
<div class="menu" data-menu="menu" aria-hidden="true">
<div class="menu-content">
<h4 class="menu-header">{{ phrase('more_options') }}</h4>
<xf:contentcheck>
<!--[XF:thread_tools_menu:top]-->
<xf:if is="$blog.canEdit()">
<a href="{{ link('blogs/blog/edit', $blog) }}" class="menu-linkRow">{{
phrase('taylorj_blogs_blog_edit') }}</a>
</xf:if>
<xf:if is="$blog.canDelete()">
<a href="{{ link('blogs/blog/delete', $blog) }}" data-xf-click="overlay" class="menu-linkRow">{{
phrase('taylorj_blogs_blog_delete') }}</a>
</xf:if>
<!--[XF:thread_tools_menu:bottom]-->
</xf:contentcheck>
</div>
</div>
</div>
</xf:if>
</div>
<xf:css src="message.less" />
<div class="block taylorjUserBlogs-block">
<div class="taylorjUserBlogs-blog-posts">
<xf:foreach loop="{$blogPosts}" key="$blog_post_id" value="$blogPost">
<div class="block-container">
<a href="{{ link('blogs/post', $blogPost) }}">
<h2 class="block-header">{$blogPost.blog_post_title}</h2>
</a>
<div class="message">
<div class="message-inner">
<div class="message-cell message-cell--main">
<div class="message-attribution">
<xf:date time="$blogPost.blog_post_date" />
<div class="u-pullRight">
{{ phrase('views') }}: {$blogPost.view_count}
</div>
</div>
<div class="message-content">
<div class="message-body">
{{ snippet($blogPost.blog_post_content, 750, {
'stripQuote': true,
'bbWrapper': true
}) }}
</div>
</div>
<xf:if is="$blogPost.blog_post_last_edit_date">
<div class="message-lastEdit">
{{ phrase('last_edited:') }} <xf:date time="$blogPost.blog_post_last_edit_date" />
</div>
</xf:if>
</div>
</div>
</div>
</div>
</xf:foreach>
<xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}"
link="blogs/blog/" data="{$blogPost}" wrapperclass="block-outer block-outer--after" />
</div>
<div class="taylorjUserBlogs-blog-details">
<div class="taylorjBlogs-blog-header-image">
<img src="{$blog.blog_header_image}" alt="Header Image" />
</div>
<div class="taylorJUserBlogs-details-text">
<dl class="pairs pairs--justified">
<dt>{{ phrase('author') }}</dt>
<dd>{$blog.User.username}</dd>
</dl>
<dl class="pairs pairs--justified">
<dt>{{ phrase('created') }}</dt>
<dd><xf:date time="$blog.blog_creation_date" /></dd>
</dl>
<dl class="pairs pairs--justified">
<dt>Entries</dt>
<dd>{$blogPost.Blog.blog_post_count|number}</dd>
</dl>
</div>
</div>
</div>
I used the XF syntax too for the blog description as you can see:
<xf:description>{$blog.blog_description}</xf:description>
This involves a small change in
taylorj_blogs_blog_view.less
:
Less:
.taylorjUserBlogs-blog-description {
padding-bottom: 40px;
//color: @xf-textColorDimmed;
}
I enjoy playing with the code a bit, you do what you want with my suggestions, they can be thrown in the trash, no offense here.