Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Block/Post/AbstractPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,19 @@ public function getStyleViewModel()

return $viewModel;
}

/**
* Check if AddThis Enabled and key exist
*
* @return bool
*/
public function displayAddThisToolbox()
{
$isSocialEnabled = $this->_scopeConfig->getValue(
'mfblog/social/add_this_enabled', ScopeInterface::SCOPE_STORE);
$isSocialIdExist = $this->_scopeConfig->getValue(
'mfblog/social/add_this_pubid', ScopeInterface::SCOPE_STORE);

return $isSocialEnabled && $isSocialIdExist;
}
}
29 changes: 16 additions & 13 deletions view/frontend/templates/post/list/item.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Blog post list item template
*
* @var $block \Magefan\Blog\Block\Post\AbstractPost
* @var $block \Magefan\Blog\Block\Post\PostList\Item
*/
?>
<?php
Expand All @@ -21,25 +21,28 @@ $_postName = $block->escapeHtml($_post->getTitle());
<li class="post-holder post-holder-<?= (int)$_post->getId() ?>">
<div class="post-header">

<div class="post-title-holder clearfix">
<div class="post-title-holder">
<h2 class="post-title">
<a class="post-item-link"
href="<?= /*@noEscape*/ $_postUrl ?>">
<?= /*@noEscape*/ $_postName ?>
</a>
</h2>

<div class="addthis_toolbox addthis_default_style"
addthis:url="<?= /*@noEscape*/ $_postUrl ?>"
addthis:title="<?= /*@noEscape*/ $_postName ?>"
<?php if ($firstImage = $_post->getFirstImage()) { ?>
addthis:media="<?= $block->escapeHtml($firstImage) ?>"
<?php } ?>>
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
</div>
<?php if ($block->displayAddThisToolbox()) : ?>
<div class="addthis_toolbox addthis_default_style"
addthis:url="<?= /*@noEscape*/ $_postUrl ?>"
addthis:title="<?= /*@noEscape*/ $_postName ?>"
<?php if ($firstImage = $_post->getFirstImage()) { ?>
addthis:media="<?= $block->escapeHtml($firstImage) ?>"
<?php } ?>>
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
</div>
<?php endif; ?>

</div>

<?= /*@noEscape*/ $block->getInfoHtml() ?>
Expand Down
21 changes: 12 additions & 9 deletions view/frontend/templates/post/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ $_postName = $block->escapeHtml($_post->getTitle(), null);
?>
<div class="post-view">
<div class="post-holder post-holder-<?= (int)$_post->getId() ?>">
<div class="post-header clearfix">
<div class="addthis_toolbox addthis_default_style" addthis:url="<?= $block->escapeUrl($_postUrl) ?>">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
</div>
<?= $block->getInfoHtml() ?>
</div>

<?php if ($block->displayAddThisToolbox()) : ?>
<div class="post-header">
<div class="addthis_toolbox addthis_default_style" addthis:url="<?= $block->escapeUrl($_postUrl) ?>">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
</div>
<?= $block->getInfoHtml() ?>
</div>
<?php endif; ?>

<div class="post-content">
<div class="post-description clearfix">
Expand Down
7 changes: 3 additions & 4 deletions view/frontend/web/css/blog-m.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@
.post-content .post-description .post-ftimg-hld img {width:100%; padding:0; margin:0;}

/* Post Title */
.post-list .post-header .post-title-holder:before {content: "";display: table;}
.post-list .post-header .post-title-holder:after {content: "";display: table;clear: both;}
.post-list .post-header .post-title {max-width:80%;margin: 0;padding: 10px 0;}
.post-list .post-header .post-title-holder {display: flex;align-items: center;justify-content: space-between;flex-wrap: wrap;}
.post-list .post-header .post-title {margin: 0;padding: 10px 0;}
.post-list .post-header .post-title a {text-decoration: none;font-size: 22px;font-weight: 400;}
.post-list .post-holder .post-header .addthis_toolbox {float: right; padding-top: 20px;}
.post-list .post-holder .post-header .addthis_toolbox a {margin-bottom: 0;}

.post-list .hidden {display:none;}
.post-view .post-bottom {margin-top:30px;}
Expand Down