ltsecurityinc安防产品在线商城代码
This commit is contained in:
+94
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* Athlete2 Theme
|
||||
* Blog recent posts widget
|
||||
*
|
||||
* @var $block \Magefan\Blog\Block\Widget\Recent
|
||||
*
|
||||
* @category Olegnax
|
||||
* @package Olegnax_Athlete2
|
||||
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$theme_helper = $this->helper('Olegnax\Athlete2\Helper\Helper');
|
||||
$at_settings = $theme_helper->getConfig('athlete2_settings/blog');
|
||||
$_hideReadMore = $at_settings['blog_list_read_more'];
|
||||
$_hideCategories = $at_settings['blog_list_categories'];
|
||||
$iBigWidth = $at_settings['blog_list_big_image_width'];
|
||||
$iBigHeight = $at_settings['blog_list_big_image_height'];
|
||||
$imgAttrs='';
|
||||
$classes = [];
|
||||
$classes[] = 'blog-list--above-image';
|
||||
$classes[] = 'blog-style-modern';
|
||||
if($theme_helper->getConfig('athlete2_design/blog_list/big_post_white')){
|
||||
$classes[] = 'white-style';
|
||||
}
|
||||
$classesOutput = implode(' ', $classes);
|
||||
?>
|
||||
|
||||
<?php
|
||||
$_postCollection = $block->getPostCollection();
|
||||
?>
|
||||
<?php if ($_postCollection->count()) { ?>
|
||||
<div class="post-list-wrapper widget blog-widget-recent">
|
||||
<?php $blockTitle = $block->escapeHtml($block->getData('title'));
|
||||
if ($blockTitle){ ?>
|
||||
<h3 class="title"><?= $blockTitle ?></h3>
|
||||
<?php } ?>
|
||||
<div class="post-list clearfix <?= $classesOutput ?>">
|
||||
<?php foreach ($_postCollection as $_post) { ?>
|
||||
<?php
|
||||
$_postUrl = $block->escapeUrl($_post->getPostUrl());
|
||||
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
|
||||
$_categoriesCount = $_post->getCategoriesCount();
|
||||
if($iBigWidth && $iBigHeight) {
|
||||
$imgAttrs .=' width="' . $iBigWidth . '" height="' . $iBigHeight . '" ';
|
||||
$bigFeaturedImage = $_post->getFeaturedImage([$iBigWidth, $iBigHeight]);
|
||||
} else {
|
||||
$bigFeaturedImage = $_post->getFeaturedImage();
|
||||
}
|
||||
?>
|
||||
<article class="post-holder post-holder-<?php echo (int)$_post->getId() ?>">
|
||||
<?php if ($bigFeaturedImage) { ?>
|
||||
<div class="post-image-wrapper post-image-cover">
|
||||
<img src="<?php echo $block->escapeUrl($bigFeaturedImage) ?>" alt="<?php echo $block->escapeHtmlAttr($_postName) ?>" <?php echo $block->escapeHtmlAttr($imgAttrs) ?>/>
|
||||
<div class="gradient-overlay"></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-content">
|
||||
<?php if ( $_categoriesCount ) { ?>
|
||||
<div class="item post-categories">
|
||||
<?php $n = 0; foreach($_post->getParentCategories() as $ct) { $n++; ?>
|
||||
<a title="<?php echo $block->escapeHtml($ct->getTitle()) ?>" href="<?php echo $block->escapeUrl($ct->getCategoryUrl()) ?>">
|
||||
<?php echo $block->escapeHtml($ct->getTitle()) ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
<?php if ($content = $block->getShorContent($_post)) { ?>
|
||||
<div class="post-description clearfix">
|
||||
<?php echo $content ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-links">
|
||||
<?php if (!$_hideReadMore) { ?>
|
||||
<a class="item post-read-more" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<?php echo __('Read more') ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* Athlete2 Theme
|
||||
* Blog recent posts widget
|
||||
*
|
||||
* @var $block Recent
|
||||
*
|
||||
* @category Olegnax
|
||||
* @package Olegnax_Athlete2
|
||||
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
use Magefan\Blog\Block\Widget\Recent;
|
||||
|
||||
?>
|
||||
<?php
|
||||
$theme_helper = $this->helper('Olegnax\Athlete2\Helper\Helper');
|
||||
$at_settings = $theme_helper->getConfig('athlete2_settings/blog');
|
||||
$_hideReadMore = $at_settings['blog_list_read_more'];
|
||||
$_hideCategories = $at_settings['blog_list_categories'];
|
||||
$gWidth = $at_settings['blog_list_image_width'];
|
||||
$gHeight = $at_settings['blog_list_image_height'];
|
||||
$iWidth = $at_settings['blog_widget_image_width'];
|
||||
$iHeight = $at_settings['blog_widget_image_height'];
|
||||
$columns = $at_settings['widget_columns'];
|
||||
if(!$columns) {
|
||||
$columns= 3;
|
||||
}
|
||||
$classes = [];
|
||||
$classes[] = 'columns-' . $columns;
|
||||
$classes[] = 'blog-list--overlay';
|
||||
$classes[] = 'blog-style-modern';
|
||||
if($theme_helper->getConfig('athlete2_design/blog_list/big_post_white')){
|
||||
$classes[] = 'white-style';
|
||||
}
|
||||
$classesOutput = implode(' ', $classes);
|
||||
$shortDesc = false;
|
||||
$imgAttrs='';
|
||||
if($iWidth || $gWidth) {
|
||||
$imgAttrs .=' width="' . ($iWidth ?: $gWidth ) . '" ';
|
||||
}
|
||||
if($iHeight || $gHeight) {
|
||||
$imgAttrs .=' height="' . ($iHeight ?: $gHeight) . '" ';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$_postCollection = $block->getPostCollection();
|
||||
?>
|
||||
<?php if ($_postCollection->count()) { ?>
|
||||
<div class="post-list-wrapper widget blog-widget-recent">
|
||||
<?php $blockTitle = $block->escapeHtml($block->getData('title'));
|
||||
if ($blockTitle){ ?>
|
||||
<h3 class="title"><?= $blockTitle ?></h3>
|
||||
<?php } ?>
|
||||
<div class="post-list clearfix <?= $classesOutput ?>">
|
||||
<?php foreach ($_postCollection as $_post) { ?>
|
||||
<?php
|
||||
$_postUrl = $block->escapeUrl($_post->getPostUrl());
|
||||
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
|
||||
$_categoriesCount = $_post->getCategoriesCount();
|
||||
if($iWidth && $iHeight) {
|
||||
$featuredImage = $_post->getFeaturedImage([$iWidth, $iHeight]);
|
||||
} elseif ($gWidth && $gHeight) {
|
||||
$featuredImage = $block->escapeUrl($_post->getFeaturedImage([$gWidth, $gHeight]));
|
||||
} else {
|
||||
$featuredImage = $block->escapeUrl($_post->getFeaturedImage());
|
||||
}
|
||||
?>
|
||||
<article class="post-holder post-holder-<?php echo (int)$_post->getId() ?>">
|
||||
<?php if ($featuredImage) { ?>
|
||||
<div class="post-image-wrapper post-image-cover">
|
||||
<img class="post-image-cover" src="<?php echo $block->escapeUrl($featuredImage) ?>" alt="<?php echo $block->escapeHtmlAttr($_postName) ?>" <?php echo $block->escapeHtmlAttr($imgAttrs) ?>/>
|
||||
<div class="gradient-overlay"></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-content">
|
||||
<?php if ( $_categoriesCount ) { ?>
|
||||
<div class="item post-categories">
|
||||
<?php $n = 0; foreach($_post->getParentCategories() as $ct) { $n++; ?>
|
||||
<a title="<?php echo $block->escapeHtml($ct->getTitle()) ?>" href="<?php echo $block->escapeUrl($ct->getCategoryUrl()) ?>">
|
||||
<?php echo $block->escapeHtml($ct->getTitle()) ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
<?php if ($content = $block->getShorContent($_post) && $shortDesc) { ?>
|
||||
<div class="post-description clearfix">
|
||||
<?php echo $content ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-links">
|
||||
<?php if (!$_hideReadMore) { ?>
|
||||
<a class="item post-read-more" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<?php echo __('Read more') ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Athlete2 Theme
|
||||
* Blog recent posts widget
|
||||
*
|
||||
* @var $block Recent
|
||||
*
|
||||
* @category Olegnax
|
||||
* @package Olegnax_Athlete2
|
||||
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
use Magefan\Blog\Block\Widget\Recent;
|
||||
|
||||
$_styleClassic = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/blog/blog_style_classic');
|
||||
$classes = $_styleClassic?'blog-style-classic':'blog-style-modern';
|
||||
$_postCollection = $block->getPostCollection();
|
||||
?>
|
||||
<?php if ($_postCollection->count()) { ?>
|
||||
<div class="post-list-wrapper blog-widget-recent ox-blog-widget__titles-only">
|
||||
<?php $blockTitle = $block->escapeHtml($block->getData('title'));
|
||||
if ($blockTitle){ ?>
|
||||
<h3 class="title"><?= $blockTitle ?></h3>
|
||||
<?php } ?>
|
||||
<div class="post-list clearfix <?= $classes ?>">
|
||||
<?php foreach ($_postCollection as $_post) { ?>
|
||||
<?php
|
||||
$_postUrl = $block->escapeUrl($_post->getPostUrl());
|
||||
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
|
||||
$_categoriesCount = $_post->getCategoriesCount();
|
||||
$dateMonth =$block->escapeHtml($_post->getPublishDate('F'));
|
||||
if(strlen($dateMonth) > 4){
|
||||
$dateMonth = substr($dateMonth, 0, 3);
|
||||
}
|
||||
?>
|
||||
<article class="post-holder post-holder-<?php echo (int)$_post->getId() ?>">
|
||||
<?php if ($_styleClassic) { ?>
|
||||
<div class="post-date">
|
||||
<div class="inner"><span class="day"><?php echo $_post->getPublishDate('d' )?></span><?php echo $dateMonth ?></div>
|
||||
<div class="hover"><span class="day"><?php echo $_post->getPublishDate('d') ?></span><?php echo $dateMonth ?></div>
|
||||
</div>
|
||||
<div class="post-content">
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="post-content">
|
||||
<?php if ( $_categoriesCount ) { ?>
|
||||
<div class="item post-categories">
|
||||
<?php $n = 0; foreach($_post->getParentCategories() as $ct) { $n++; ?>
|
||||
<a title="<?php echo $block->escapeHtml($ct->getTitle()) ?>" href="<?php echo $block->escapeUrl($ct->getCategoryUrl()) ?>">
|
||||
<?php echo $block->escapeHtml($ct->getTitle()) ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</article>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/**
|
||||
* Athlete2 Theme
|
||||
* Blog recent posts widget
|
||||
*
|
||||
* @var $block Recent
|
||||
*
|
||||
* @category Olegnax
|
||||
* @package Olegnax_Athlete2
|
||||
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
use Magefan\Blog\Block\Widget\Recent;
|
||||
|
||||
$at_settings = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/blog');
|
||||
$_styleClassic = $at_settings['blog_style_classic'];
|
||||
$_hideReadMore = $at_settings['blog_list_read_more'];
|
||||
$_hideCommentsLink = $at_settings['blog_list_comments_link'];
|
||||
$_hideAuthor = $at_settings['blog_list_author'];
|
||||
$_hideDate = $at_settings['blog_list_date'];
|
||||
$_hideCategories = $at_settings['blog_list_categories'];
|
||||
$_dateOnImage = $at_settings['blog_list_date_image'];
|
||||
$gWidth = $at_settings['blog_list_image_width'];
|
||||
$gHeight = $at_settings['blog_list_image_height'];
|
||||
$iWidth = $at_settings['blog_widget_image_width'];
|
||||
$iHeight = $at_settings['blog_widget_image_height'];
|
||||
$columns = $at_settings['widget_columns'];
|
||||
$imgAttrs='';
|
||||
if(!$columns) {
|
||||
$columns= 3;
|
||||
}
|
||||
$_postClasses = '';
|
||||
if($_dateOnImage){
|
||||
$_postClasses = ' date-above-image';
|
||||
}
|
||||
$classes = [];
|
||||
$classes[] = 'blog-list--image-top';
|
||||
$classes[] = 'columns-' . $columns;
|
||||
if($at_settings['blog_style_classic']){
|
||||
$classes[] = 'blog-style-classic ';
|
||||
} else{
|
||||
$classes[] = 'blog-style-modern ';
|
||||
}
|
||||
$classesOutput = implode(' ', $classes);
|
||||
?>
|
||||
|
||||
<?php
|
||||
$_postCollection = $block->getPostCollection();
|
||||
?>
|
||||
<?php if ($_postCollection->count()) { ?>
|
||||
<div class="post-list-wrapper widget blog-widget-recent">
|
||||
<?php $blockTitle = $block->escapeHtml($block->getData('title'));
|
||||
if ($blockTitle){ ?>
|
||||
<h3 class="title"><?= $blockTitle ?></h3>
|
||||
<?php } ?>
|
||||
<div class="post-list clearfix <?= $classesOutput ?>">
|
||||
<?php foreach ($_postCollection as $_post) { ?>
|
||||
<?php
|
||||
$_postUrl = $block->escapeUrl($_post->getPostUrl());
|
||||
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
|
||||
$_categoriesCount = $_post->getCategoriesCount();
|
||||
$dateMonth = $block->escapeHtmlAttr($_post->getPublishDate('F'));
|
||||
if(strlen($dateMonth) > 4){
|
||||
$dateMonth = substr($dateMonth, 0, 3);
|
||||
}
|
||||
if($iWidth && $iHeight) {
|
||||
$imgAttrs .=' width="' . $iWidth . '" height="' . $iHeight . '" ';
|
||||
$featuredImage = $_post->getFeaturedImage([$iWidth, $iHeight]);
|
||||
} elseif ($gWidth && $gHeight) {
|
||||
$imgAttrs .=' width="' . $gWidth . '" height="' . $gHeight . '" ';
|
||||
$featuredImage = $_post->getFeaturedImage([$gWidth, $gHeight]);
|
||||
} else {
|
||||
$featuredImage = $_post->getFeaturedImage();
|
||||
}
|
||||
$noImage = '';
|
||||
if(!$featuredImage){
|
||||
$noImage = ' no-image';
|
||||
}
|
||||
?>
|
||||
<article class="post-holder post-holder-<?php echo (int)$_post->getId() ?><?= $_postClasses ?><?= $noImage ?>">
|
||||
<?php if ($featuredImage) { ?>
|
||||
<a class="post-image-wrapper" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<?php if($_styleClassic) { ?>
|
||||
<span class="post-date">
|
||||
<span class="inner"><span class="day"><?php echo $_post->getPublishDate('d' )?></span><?php echo $dateMonth ?></span>
|
||||
<span class="hover"><span class="day"><?php echo $_post->getPublishDate('d') ?></span><?php echo $dateMonth ?></span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if(!$_hideDate && !$_styleClassic && $_dateOnImage) { ?>
|
||||
<span class="item post-posed-date"><?php echo $_post->getPublishDate('F d, Y') ?></span>
|
||||
<?php } ?>
|
||||
<img src="<?php echo $block->escapeUrl($featuredImage) ?>" alt="<?php echo $_postName ?>" <?php echo $block->escapeHtmlAttr($imgAttrs) ?>/>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if ($_styleClassic) { ?>
|
||||
<?php if (!$featuredImage) { ?>
|
||||
<div class="post-date">
|
||||
<div class="inner"><span class="day"><?php echo $_post->getPublishDate('d' )?></span><?php echo $dateMonth ?></div>
|
||||
<div class="hover"><span class="day"><?php echo $_post->getPublishDate('d') ?></span><?php echo $dateMonth ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-content">
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="post-meta links-bg-hover">
|
||||
<?php if ( !$_hideCategories ) { ?>
|
||||
<?php if ( $_categoriesCount ) { ?>
|
||||
<div class="item post-categories">
|
||||
<?php $n = 0; foreach($_post->getParentCategories() as $ct) { $n++; ?>
|
||||
<a title="<?php echo $block->escapeHtml($ct->getTitle()) ?>" href="<?php echo $block->escapeUrl($ct->getCategoryUrl()) ?>">
|
||||
<?php echo $block->escapeHtml($ct->getTitle()) ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ($content = $block->getShorContent($_post)) { ?>
|
||||
<div class="post-description clearfix">
|
||||
<?php echo $content ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-links">
|
||||
<?php if (!$_hideReadMore) { ?>
|
||||
<a class="item button post-read-more" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<span><?php echo __('Read more') ?></span>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="post-content">
|
||||
<?php if ( $_categoriesCount ) { ?>
|
||||
<div class="item post-categories">
|
||||
<?php $n = 0; foreach($_post->getParentCategories() as $ct) { $n++; ?>
|
||||
<a title="<?php echo $block->escapeHtml($ct->getTitle()) ?>" href="<?php echo $block->escapeUrl($ct->getCategoryUrl()) ?>">
|
||||
<?php echo $block->escapeHtml($ct->getTitle()) ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="post-meta">
|
||||
<?php if(!$_hideDate ) { ?>
|
||||
<span class="item post-posed-date"><?php echo $_post->getPublishDate('F d, Y') ?></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ($content = $block->getShorContent($_post)) { ?>
|
||||
<div class="post-description clearfix">
|
||||
<?php echo $content ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-links">
|
||||
<?php if (!$_hideReadMore) { ?>
|
||||
<a class="item post-read-more" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<?php echo __('Read more') ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</article>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
+191
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* Athlete2 Theme
|
||||
* Blog recent posts widget
|
||||
*
|
||||
* @var $block Recent
|
||||
*
|
||||
* @category Olegnax
|
||||
* @package Olegnax_Athlete2
|
||||
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
use Magefan\Blog\Block\Widget\Recent;
|
||||
|
||||
?>
|
||||
<?php
|
||||
$at_settings = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/blog');
|
||||
$_styleClassic = $at_settings['blog_style_classic'];
|
||||
$_hideReadMore = $at_settings['blog_list_read_more'];
|
||||
$_hideCommentsLink = $at_settings['blog_list_comments_link'];
|
||||
$_hideAuthor = $at_settings['blog_list_author'];
|
||||
$_hideDate = $at_settings['blog_list_date'];
|
||||
$_hideCategories = $at_settings['blog_list_categories'];
|
||||
$_dateOnImage = $at_settings['blog_list_date_image'];
|
||||
$gWidth = $at_settings['blog_list_image_width'];
|
||||
$gHeight = $at_settings['blog_list_image_height'];
|
||||
$iWidth = $at_settings['blog_widget_image_width'];
|
||||
$iHeight = $at_settings['blog_widget_image_height'];
|
||||
$columns = $at_settings['widget_columns'];
|
||||
$imgAttrs='';
|
||||
if(!$columns) {
|
||||
$columns= 3;
|
||||
}
|
||||
$_postClasses = '';
|
||||
if($_dateOnImage){
|
||||
$_postClasses = ' date-above-image';
|
||||
}
|
||||
$classes = [];
|
||||
$classes[] = 'blog-list--image-top';
|
||||
$classes[] = 'columns-' . $columns;
|
||||
if($at_settings['blog_style_classic']){
|
||||
$classes[] = 'blog-style-classic ';
|
||||
} else{
|
||||
$classes[] = 'blog-style-modern ';
|
||||
}
|
||||
$classesOutput = implode(' ', $classes);
|
||||
?>
|
||||
|
||||
<?php
|
||||
$_postCollection = $block->getPostCollection();
|
||||
?>
|
||||
<?php if ($_postCollection->count()) { ?>
|
||||
<div class="post-list-wrapper blog-widget-recent blog-widget-recent-masonry">
|
||||
<?php $blockTitle = $block->escapeHtml($block->getData('title'));
|
||||
if ($blockTitle){ ?>
|
||||
<h3 class="title"><?= $blockTitle ?></h3>
|
||||
<?php } ?>
|
||||
<div class="post-list clearfix <?= $classesOutput ?>">
|
||||
<?php foreach ($_postCollection as $_post) { ?>
|
||||
<?php
|
||||
$_postUrl = $block->escapeUrl($_post->getPostUrl());
|
||||
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
|
||||
$_categoriesCount = $_post->getCategoriesCount();
|
||||
$dateMonth = $block->escapeHtmlAttr($_post->getPublishDate('F'));
|
||||
if(strlen($dateMonth) > 4){
|
||||
$dateMonth = substr($dateMonth, 0, 3);
|
||||
}
|
||||
if($iWidth && $iHeight) {
|
||||
$imgAttrs .=' width="' . $iWidth . '" height="' . $iHeight . '" ';
|
||||
$featuredImage = $_post->getFeaturedImage([$iWidth, $iHeight]);
|
||||
} elseif ($gWidth && $gHeight) {
|
||||
$imgAttrs .=' width="' . $gWidth . '" height="' . $gHeight . '" ';
|
||||
$featuredImage =$_post->getFeaturedImage([$gWidth, $gHeight]);
|
||||
} else {
|
||||
$featuredImage = $_post->getFeaturedImage();
|
||||
}
|
||||
$noImage = '';
|
||||
if(!$featuredImage){
|
||||
$noImage = ' no-image';
|
||||
}
|
||||
?>
|
||||
<article class="post-holder post-holder-<?php echo (int)$_post->getId() ?><?= $_postClasses ?><?= $noImage ?>">
|
||||
<?php if ($featuredImage) { ?>
|
||||
<a class="post-image-wrapper" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<?php if($_styleClassic) { ?>
|
||||
<span class="post-date">
|
||||
<span class="inner"><span class="day"><?php echo $_post->getPublishDate('d' )?></span><?php echo $dateMonth ?></span>
|
||||
<span class="hover"><span class="day"><?php echo $_post->getPublishDate('d') ?></span><?php echo $dateMonth ?></span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if(!$_hideDate && !$_styleClassic && $_dateOnImage) { ?>
|
||||
<span class="item post-posed-date"><?php echo $_post->getPublishDate('F d, Y') ?></span>
|
||||
<?php } ?>
|
||||
<img src="<?php echo $block->escapeUrl($featuredImage) ?>" alt="<?php echo $_postName ?>" <?php echo $block->escapeHtmlAttr($imgAttrs) ?> />
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if ($_styleClassic) { ?>
|
||||
<?php if (!$featuredImage) { ?>
|
||||
<div class="post-date">
|
||||
<div class="inner"><span class="day"><?php echo $_post->getPublishDate('d' )?></span><?php echo $dateMonth ?></div>
|
||||
<div class="hover"><span class="day"><?php echo $_post->getPublishDate('d') ?></span><?php echo $dateMonth ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-content">
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="post-meta links-bg-hover">
|
||||
<?php if ( !$_hideCategories ) { ?>
|
||||
<?php if ( $_categoriesCount ) { ?>
|
||||
<div class="item post-categories">
|
||||
<?php $n = 0; foreach($_post->getParentCategories() as $ct) { $n++; ?>
|
||||
<a title="<?php echo $block->escapeHtml($ct->getTitle()) ?>" href="<?php echo $block->escapeUrl($ct->getCategoryUrl()) ?>">
|
||||
<?php echo $block->escapeHtml($ct->getTitle()) ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ($content = $block->getShorContent($_post)) { ?>
|
||||
<div class="post-description clearfix">
|
||||
<?php echo $content ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-links">
|
||||
<?php if (!$_hideReadMore) { ?>
|
||||
<a class="item button post-read-more" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<span><?php echo __('Read more') ?></span>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="post-content">
|
||||
<?php if ( $_categoriesCount ) { ?>
|
||||
<div class="item post-categories">
|
||||
<?php $n = 0; foreach($_post->getParentCategories() as $ct) { $n++; ?>
|
||||
<a title="<?php echo $block->escapeHtml($ct->getTitle()) ?>" href="<?php echo $block->escapeUrl($ct->getCategoryUrl()) ?>">
|
||||
<?php echo $block->escapeHtml($ct->getTitle()) ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<h2 class="post-title">
|
||||
<a class="post-item-link" href="<?php echo $_postUrl ?>">
|
||||
<?php echo $_postName; ?>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="post-meta">
|
||||
<?php if(!$_hideDate ) { ?>
|
||||
<span class="item post-posed-date"><?php echo $_post->getPublishDate('F d, Y') ?></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ($content = $block->getShorContent($_post)) { ?>
|
||||
<div class="post-description clearfix">
|
||||
<?php echo $content ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-links">
|
||||
<?php if (!$_hideReadMore) { ?>
|
||||
<a class="item post-read-more" href="<?php echo $_postUrl ?>" title="<?php echo $_postName ?>">
|
||||
<?php echo __('Read more') ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</article>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
requirejs( [ 'require', 'jquery', 'Magefan_Blog/js/lib/masonry.pkgd.min' ],
|
||||
function( require, $, Masonry ) {
|
||||
require( [ 'jquery-bridget/jquery-bridget' ],
|
||||
function( jQueryBridget ) {
|
||||
jQueryBridget( 'masonry', Masonry, $ );
|
||||
$('.blog-widget-recent-masonry .post-list').masonry({
|
||||
itemSelector: '.post-holder',
|
||||
percentPosition: true
|
||||
})
|
||||
});
|
||||
});
|
||||
<?php /* more info http://masonry.desandro.com/extras.html */ ?>
|
||||
</script>
|
||||
<?php } ?>
|
||||
Reference in New Issue
Block a user