ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,33 @@
<?php
/**
* Blog post author template
*
* @var $block Info
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\Info;
?>
<?php
$_post = $block->getPost();
$_authorEnabled = $block->authorEnabled();
$_authorPageEnabled = $block->authorPageEnabled();
?>
<?php if ($_authorEnabled) { ?>
<?php if ($_author = $_post->getAuthor()) { ?>
<?php if ($_authorPageEnabled) { ?>
<a class="item post-author" title="<?php echo $block->escapeHtml($_author->getTitle()) ?>" href="<?php echo $block->escapeUrl($_author->getAuthorUrl()) ?>">
<?php } ?>
<?php echo $block->escapeHtml($_author->getTitle()) ?>
<?php if ($_authorPageEnabled) { ?>
</a>
<?php } ?>
<?php } ?>
<?php } ?>
@@ -0,0 +1,27 @@
<?php
/**
* Blog post categories template
*
* @var $block \Magefan\Blog\Block\Post\Info
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
?>
<?php
$_post = $block->getPost();
$_categoriesCount = $_post->getCategoriesCount();
?>
<?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 } ?>
@@ -0,0 +1,27 @@
<?php
/**
* Blog post comments link template
*
* @var $block Info
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\Info;
?>
<?php
$_post = $block->getPost();
$_magefanCommentsEnabled = $this->magefanCommentsEnabled();
?>
<?php if ( $_magefanCommentsEnabled && $_post->getCommentsCount() ) { ?>
<a class="item" title="<?php echo $block->escapeHtml( $_post->getTitle() ) ?>" href="<?php echo $block->escapeUrl($_post->getPostUrl()) ?>#post-comments">
<span class="label"><?php echo __( 'Comments' ) ?></span>
<?php echo $block->escapeHtml( $_post->getCommentsCount() ) ?>
</a>
<?php } ?>
@@ -0,0 +1,53 @@
<?php
/**
* Blog post list template
*
* @var $block \Magefan\Blog\Block\Post\PostList
*
* @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');
$_postCollection = $block->getPostCollection();
$classes = [];
if($at_settings['blog_style_classic']){
$classes[] = 'blog-style-classic';
} else{
$classes[] = 'blog-style-modern';
}
if($at_settings['blog_list_style']){
$classes[] = 'blog-list--' . $at_settings['blog_list_style'];
}
if($at_settings['blog_list_columns']){
$classes[] = 'columns-' . $at_settings['blog_list_columns'];
}
if($theme_helper->getConfig('athlete2_design/blog_list/big_post_white')){
$classes[] = 'white-style';
}
$classesOutput = implode(' ', $classes);
?>
<?php if (!$_postCollection->count()): ?>
<div class="message info empty"><div><?php echo __('We can\'t find posts matching the selection.') ?></div></div>
<?php else: ?>
<?php echo $block->getAdditionalHtml() ?>
<?php $iterator = 1; ?>
<div class="post-list <?= $classesOutput ?>">
<?php foreach ($_postCollection as $_post): ?>
<?php echo $block->getPostHtml($_post) ?>
<?php endforeach; ?>
<div class="hidden">
<script type="text/javascript">
if (window.addthis) {
addthis.toolbox('.addthis_toolbox');
}
</script>
</div>
</div>
<?php echo $block->getToolbarHtml() ?>
<?php echo $this->getChildHtml('addthisJs'); ?>
<?php endif; ?>
@@ -0,0 +1,189 @@
<?php
/**
* Blog post list item template
*
* @var $block AbstractPost
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\AbstractPost;
$at_settings = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/blog');
$_post = $this->getPost();
$_postClasses = [];
$_postClassesOutput ='';
$_postClasses[] = 'post-holder';
$_postClasses[] = 'post-holder-' . (int)$_post->getId();
if($_post->getData('ox_post_list_style')){
$_postClasses[] = 'post-style--' . $block->escapeHtmlAttr($_post->getData('ox_post_list_style'));
}
$_postUrl = $block->escapeUrl($_post->getPostUrl());
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
$_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'];
$_hideViewsCount = $at_settings['blog_list_views_count'];
$_hideDate = $at_settings['blog_list_date'];
$_hideCategories = $at_settings['blog_list_categories'];
$iBigWidth = $at_settings['blog_list_big_image_width'];
$iBigHeight = $at_settings['blog_list_big_image_height'];
$iWidth = $at_settings['blog_list_image_width'];
$iHeight = $at_settings['blog_list_image_height'];
$imgAttrs ='';
$imgBigAttrs ='';
if($iBigWidth ) {
$imgBigAttrs ='width="' . $iBigWidth . '"';
}
if($iBigHeight) {
$imgAttrs ='height="' . $iBigHeight . '"';
}
if($iWidth ) {
$imgAttrs ='width="' . $iWidth . '"';
}
if($iHeight) {
$imgAttrs ='height="' . $iHeight . '"';
}
$hide_desc = $at_settings['description'];
$expand = $at_settings['description_expand'];
$maxheight = $at_settings['description_expand_height'];
$metaContent = '';
$metaContentModern = '';
if($iWidth && $iHeight) {
$featuredImage = $_post->getFeaturedImage([$iWidth, $iHeight]);
} else {
$featuredImage = $_post->getFeaturedImage();
}
if($iBigWidth && $iBigHeight) {
$bigFeaturedImage = $_post->getFeaturedImage([$iBigWidth, $iBigHeight]);
} else {
$bigFeaturedImage = $_post->getFeaturedImage();
}
$_dateOnImage = $at_settings['blog_list_date_image'];
$_listStyle = $at_settings['blog_list_style'];
$dateMonth = $block->escapeHtmlAttr($_post->getPublishDate('F'));
if(strlen($dateMonth) > 4){
$dateMonth = $block->escapeHtmlAttr(substr($dateMonth, 0, 3));
}
if($_dateOnImage){
$_postClasses[] = 'date-above-image';
}
if(!empty($_postClasses)){
$_postClassesOutput = 'class="' . implode(' ', $_postClasses) . '"';
}
if ( !$_hideCommentsLink ) {
$metaContent .= $this->getChildBlock( "blog.post.ox_comments_link" )->setData('post', $_post )->toHtml();
}
if ( !$_hideCategories ) {
$metaContent .= $this->getChildBlock( "blog.post.ox_categories" )->setData('post', $_post )->toHtml();
}
if ( !$_hideAuthor ) {
$metaContent .= $this->getChildBlock( "blog.post.ox_author" )->setData('post', $_post )->toHtml();
}
if ( !$_hideViewsCount ) {
$metaContent .= $this->getChildBlock( "blog.post.ox_views_count" )->setData('post', $_post )->toHtml();
}
if(!$_hideDate && !($_listStyle === 'above-image' || $_post->getData('ox_post_list_style') === 'above-image' || $_listStyle === 'overlay' || $_post->getData('ox_post_list_style') === 'overlay') && !$_dateOnImage) {
$metaContentModern .= '<span class="item post-posed-date">' . $_post->getPublishDate('F d, Y') . '</span>';
}
if ( !$_hideAuthor && !($_listStyle === 'above-image' || $_post->getData('ox_post_list_style') === 'above-image' || $_listStyle === 'overlay' || $_post->getData('ox_post_list_style') === 'overlay')) {
$metaContentModern .= $this->getChildBlock( "blog.post.ox_author" )->setData('post', $_post )->toHtml();
}
?>
<article <?= $_postClassesOutput ?>>
<?php if ($featuredImage) { ?>
<?php if (!$_styleClassic && ($_listStyle === 'above-image' || $_post->getData('ox_post_list_style') === 'above-image' || $_listStyle === 'overlay' || $_post->getData('ox_post_list_style') === 'overlay')) { ?>
<div class="post-image-wrapper post-image-cover">
<?php if ($bigFeaturedImage) { ?>
<img src="<?php echo $block->escapeUrl($bigFeaturedImage) ?>" alt="<?php echo $block->escapeHtmlAttr($_postName) ?>" <?php echo $block->escapeHtmlAttr($imgBigAttrs) ?>/>
<?php } ?>
<div class="gradient-overlay"></div>
</div>
<?php } else { ?>
<a class="post-image-wrapper" href="<?php echo $_postUrl ?>" title="<?php echo $block->escapeHtmlAttr($_postName) ?>">
<?php if(!$_hideDate && !$_styleClassic && $_dateOnImage) { ?>
<span class="item post-posed-date"><?php echo $_post->getPublishDate('F d, Y') ?></span>
<?php } ?>
<?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>
<?php } ?>
<img src="<?php echo $block->escapeUrl($featuredImage) ?>" alt="<?php echo $block->escapeHtmlAttr($_postName) ?>" <?php echo $block->escapeHtmlAttr($imgAttrs) ?>/>
</a>
<?php } ?>
<?php } ?>
<?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">
<?php echo $this->getChildBlock( "blog.post.ox_title_link" )->setData('post', $_post )->toHtml(); ?>
<?php if($metaContent){ ?>
<div class="post-meta links-bg-hover">
<?php echo $metaContent ?>
</div>
<?php } ?>
<div class="post-description clearfix">
<?php echo $block->getShorContent() ?>
</div>
<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 } ?>
<?php echo $this->getChildBlock( "blog.post.ox_share" )->setData('post', $_post )->toHtml(); ?>
</div>
</div>
<?php } else { ?>
<div class="post-content">
<?php if(!$_hideCategories) { echo $this->getChildBlock( "blog.post.ox_categories" )->setData('post', $_post )->toHtml(); } ?>
<?php echo $this->getChildBlock( "blog.post.ox_title_link" )->setData('post', $_post )->toHtml(); ?>
<?php if($metaContentModern) { ?>
<div class="post-meta">
<?php echo $metaContentModern ?>
</div>
<?php } ?>
<?php if(!$hide_desc) { ?>
<?php if($expand) { ?>
<div class="post-description ox-expand minimized clearfix" data-max-height="<?= $block->escapeHtmlAttr($maxheight) ?: '90' ?>">
<div class="ox-expand__inner" aria-expanded="false" style="max-height: <?= $block->escapeHtmlAttr($maxheight) ?: '90' ?>px;">
<?php echo $block->getShorContent() ?>
</div>
<div class="ox-expand__link">
<span class="more"><?= __('Show more') ?></span>
<span class="less"><?= __('Show less') ?></span>
</div>
</div>
<?php } else { ?>
<div class="post-description clearfix">
<?php echo $block->getShorContent() ?>
</div>
<?php } ?>
<?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 } ?>
<?php
if (!$_hideCommentsLink) {
echo $this->getChildBlock( "blog.post.ox_comments_link" )->setData('post', $_post )->toHtml();
}
echo $this->getChildBlock( "blog.post.ox_share" )->setData('post', $_post )->toHtml();
?>
</div>
</div>
<?php } ?>
</article>
@@ -0,0 +1,26 @@
<?php
/**
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
*
* Blog post info template
*
* @var $block \Magefan\Blog\Block\Post\Info
*/
?>
<?php $_post = $block->getPost() ?>
<?php if ($block->viewsCountEnabled()) { ?>
<?php if ($viewsCount = $_post->getViewsCount()) { ?>
<div class="item post-views a2-tooltip-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 3c5.392 0 9.878 3.88 10.819 9-.94 5.12-5.427 9-10.819 9-5.392 0-9.878-3.88-10.819-9C2.121 6.88 6.608 3 12 3zm0 16a9.005 9.005 0 0 0 8.777-7 9.005 9.005 0 0 0-17.554 0A9.005 9.005 0 0 0 12 19zm0-2.5a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9zm0-2a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"/></svg>
<span class="label a2-tooltip"><?= $block->escapeHtml(__('Post Views')) ?></span>
<span class="value">
<?= $block->escapeHtml($viewsCount)?>
</span>
</div>
<?php } ?>
<?php } ?>
@@ -0,0 +1,30 @@
<?php
/**
* Blog post share template
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
?>
<?php
$at_settings = $this->helper( 'Olegnax\Athlete2\Helper\Helper' )->getConfig( 'athlete2_settings/blog' );
$_hideShare = $at_settings[ 'blog_list_social' ];
$_post = $block->getPost();
$_postUrl = $block->escapeUrl($_post->getPostUrl());
$_postName = $block->escapeHtml( $_post->getTitle(), null, true );
?>
<?php if ( !$_hideShare ) {?>
<div class="social-share__content">
<a target="_blank" class="ox-social-button" href="https://twitter.com/intent/tweet?<?=
http_build_query( array( // WPCS: xss ok.
'text' => $_postName,
'url' => $_postUrl,
) )
?>"><i class="athlete2-icon-twitter"></i><span><?= __('Twitter') ?></span></a>
<a target="_blank" class="ox-social-button" href="https://www.facebook.com/sharer/sharer.php?<?= http_build_query( array( 'u' => $_postUrl ) ) ?>"><i class="athlete2-icon-facebook"></i><span><?= __('Facebook') ?></span></a>
</div>
<?php } ?>
@@ -0,0 +1,32 @@
<?php
/**
* Blog post share template
*
* @var $block Info
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\Info;
$_hideShare = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/blog/blog_list_social');
if (!$_hideShare) {
$_post = $block->getPost();
$_postUrl = $block->escapeUrl($_post->getPostUrl());
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
?>
<div class="social-share__content">
<a target="_blank" class="ox-social-button" href="https://twitter.com/intent/tweet?<?=
http_build_query(array( // WPCS: xss ok.
'text' => $_postName,
'url' => $_postUrl,
))
?>"><i class="athlete2-icon-twitter"></i><span><?= __('Twitter') ?></span></a>
<a target="_blank" class="ox-social-button"
href="https://www.facebook.com/sharer/sharer.php?<?= http_build_query(array('u' => $_postUrl)) ?>"><i
class="athlete2-icon-facebook"></i><span><?= __('Facebook') ?></span></a>
</div>
<?php } ?>
@@ -0,0 +1,111 @@
<?php
/**
* Blog post sticky template
*
* @var $block Info
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\Info;
?>
<script type="text/javascript">
require( [ 'jquery', 'domReady!'], function ( $ ) {
"use strict";
$( function () {
var postContent = $('.post-content'),
stickyHolder = $('.blog-post-sticky-info');
if(stickyHolder.length && postContent.length){
var progressBar = $('.progress-bar'),
progressText = $('.progress-counter'),
narrow = $('.post-view .post-header'),
postContentLeft = postContent.offset().left,
minPostHeight = 350,
stickyWidth = stickyHolder.width() + 20,
windowHeight = $(window).height(),
windowWidth = $(window).width(),
eltop = postContent.offset().top;
var narrowLeft = function(status){
if( narrow.length ){
if(narrow.offset().left - stickyWidth > 0){
if(status){
stickyHolder.css( { left: narrow.offset().left - stickyWidth } );
} else {
stickyHolder.css( { left: narrow.offset().left - stickyWidth - postContentLeft} );
}
} else {
if(status){
stickyHolder.css( { left: 0 } );
} else {
stickyHolder.css( { left: -(narrow.offset().left) } );
}
}
}
};
narrowLeft(false);
var updateSticky = function(){
var scrollTop = $(window).scrollTop(),
_height = 50,
$this_par_top = stickyHolder.parent().offset().top,
$scrollto_h = postContent.offset().top + postContent.height() - stickyHolder.outerHeight(true);
if ( $( '.ox-sticky' ).length > 0 )
_height += $( '.ox-sticky' ).height();
if ( scrollTop >= $scrollto_h - _height ) {
stickyHolder.addClass( '_static' ).removeClass( '_fixed' );
stickyHolder.css( { top: 'auto' } );
narrowLeft(false);
return;
}
stickyHolder.removeClass( '_static' ).toggleClass( '_fixed', scrollTop + _height >= $this_par_top );
if ( scrollTop + _height >= $this_par_top ) {
stickyHolder.css( { top: _height} );
narrowLeft(true);
} else {
narrowLeft(false);
stickyHolder.css( { top: '' } );
}
}
var setHeight = function(){
var val = windowHeight + $(window).scrollTop(),
elheight = postContent.height(),
endpos = elheight + eltop;
if (endpos < val) {
progressBar.css({ height: "100%" });
progressText.text('100%');
return;
}
var progress = ((val - eltop) / elheight) * 100;
progressBar.css({ height: progress + '%' });
progressText.text(Math.round(progress) + '%');
};
setHeight();
$( document ).on( 'scroll', function () {
if(windowWidth > 768 && postContent.height() > minPostHeight){
requestAnimationFrame( setHeight );
requestAnimationFrame( updateSticky );
}
} );
$(window).on('resize', function(){
windowWidth = $(window).width();
windowHeight = $(window).height();
postContentLeft = postContent.offset().left;
if(windowWidth > 768 && postContent.height() > minPostHeight){
$('body').removeClass('blog-short-post');
updateSticky();
setHeight();
stickyHolder.show();
} else{
stickyHolder.hide();
$('body').addClass('blog-short-post');
}
});
}
} );
} );
</script>
@@ -0,0 +1,31 @@
<?php
/**
* Blog post tags template
*
* @var $block Info
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\Info;
?>
<?php
$_post = $block->getPost();
$_tagsCount = $_post->getTagsCount();
?>
<?php if ($_tagsCount) { ?>
<div class="item post-tags">
<span class="label"><?php echo __('Tags:') ?></span>
<?php $n = 0; foreach($_post->getRelatedTags() as $tag) { $n++; ?>
<a title="<?php echo $block->escapeHtml($tag->getTitle()) ?>" href="<?php echo $block->escapeUrl($tag->getTagUrl()) ?>">
<?php echo $block->escapeHtml($tag->getTitle()) ?>
</a>
<?php } ?>
</div>
<?php } ?>
@@ -0,0 +1,25 @@
<?php
/**
* Blog post author template
*
* @var $block Info
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\Info;
?>
<?php
$_post = $block->getPost();
$_postUrl = $block->escapeUrl($_post->getPostUrl());
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
?>
<h2 class="post-title">
<a class="post-item-link" href="<?php echo $_postUrl ?>">
<?php echo $_postName; ?>
</a>
</h2>
@@ -0,0 +1,106 @@
<?php
/**
* Blog post view template
*
* @var $block View
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\View;
$at_settings = $this->helper( 'Olegnax\Athlete2\Helper\Helper' )->getConfig( 'athlete2_settings/blog_post' );
$_postClasses = [];
$_post = $this->getPost();
$_postUrl = $block->escapeUrl($_post->getPostUrl());
$_postName = $block->escapeHtml($_post->getTitle(), null, true);
$featuredImage = $block->escapeUrl($_post->getFeaturedImage());
//$_styleClassic = $at_settings[ 'blog_style_classic' ];
$_stickyProgress = $at_settings[ 'sticky_progress' ];
$_shareTitle = $at_settings[ 'share_below_title' ];
$_shareTheme = $at_settings[ 'share_below_title_theme' ];
$_shareSticky = $at_settings[ 'share_sticky' ];
$_hideTags = $at_settings[ 'hide_tags' ];
$_hideAuthor = $at_settings[ 'hide_author' ];
$_hideFeatured = $at_settings[ 'hide_featured' ];
$_hideCategories = $at_settings[ 'hide_categories' ];
$_hideDate = $at_settings[ 'hide_date' ];
$_hideCommentsLink = $at_settings[ 'hide_comments_link' ];
/*if($_styleClassic){
$_postClasses[] = 'blog-style-classic';
}*/
if($at_settings[ 'narrow_post' ]){
$_postClasses[] = 'narrow-post';
}
if($at_settings[ 'narrow_post_p' ]){
$_postClasses[] = 'narrow-post--p';
}
if($at_settings[ 'narrow_post_content' ]){
$_postClasses[] = 'narrow-post--content';
}
if($_shareSticky && !$_shareTitle ){
$_postClasses[] = 'sticky-share-only';
}
$_postClassesOutput = implode(' ', $_postClasses);
?>
<div class="post-view <?php echo $block->escapeHtml($_postClassesOutput) ?>">
<?php echo $this->getChildHtml( 'breadcrumbs' ); ?>
<div class="post-holder post-holder-<?php echo (int)$_post->getId() ?>">
<div class="post-header clearfix">
<?php if ( !$_hideCategories ) { echo $this->getChildBlock( "blog.post.ox_categories" )->setData('post', $_post )->toHtml(); } ?>
<?php echo $this->getChildHtml( 'page.main.title' ); ?>
<div class="post-meta">
<?php if(!$_hideDate) { ?><span class="item post-posed-date"><?php echo $block->escapeHtml($_post->getPublishDate('F d, Y')) ?></span><?php } ?>
<?php if ( !$_hideAuthor ) { echo $this->getChildBlock( "blog.post.ox_author" )->setData('post', $_post )->toHtml(); } ?>
<?php if ( !$_hideCommentsLink ) { echo $this->getChildBlock( "blog.post.ox_comments_link" )->setData('post', $_post )->toHtml(); } ?>
<?php if ($_shareSticky && !$_shareTitle ) { echo $this->getChildBlock( "blog.post.ox_share_theme" )->setData('post', $_post )->toHtml(); } ?>
<?php echo $this->getChildBlock( "blog.post.ox_views_count" )->setData('post', $_post )->toHtml(); ?>
<?php if ( $_shareTitle ) { ?>
<?php if ( $_shareTheme ) { ?>
<?php echo $this->getChildBlock( "blog.post.ox_share_theme" )->setData('post', $_post )->toHtml(); ?>
<?php } else { ?>
<?php if ($block->displayAddThisToolbox()) : ?>
<div class="addthis_toolbox addthis_inline_share_toolbox" addthis:url="<?php echo $block->escapeUrl($_postUrl) ?>">
</div>
<?php endif; ?>
<?php } ?>
<?php } ?>
</div>
</div>
<div class="post-content">
<?php if ($_stickyProgress || $_shareSticky) { ?>
<div class="blog-post-sticky-info">
<?php if ($_shareSticky) { echo $this->getChildBlock( "blog.post.ox_share_theme" )->setData('post', $_post )->toHtml(); } ?>
<?php if ($_stickyProgress) { ?>
<div class="progress-container">
<span class="progress-bar"></span>
</div>
<h6 class="progress-counter">0%</h6>
<?php } ?>
</div>
<?php } ?>
<div class="post-description clearfix">
<?php if ($featuredImage && !$_hideFeatured) { ?>
<div class="post-ftimg-hld">
<img src="<?php echo $featuredImage ?>" alt="<?php echo $_postName ?>" />
</div>
<?php } ?>
<div class="post-text-hld">
<?php echo $block->getContent() ?>
<div class="clear"></div>
</div>
<?php if(!$_hideTags) { echo $this->getChildBlock( "blog.post.ox_tags" )->setData('post', $_post )->toHtml(); } ?>
</div>
</div>
<div class="post-bottom container">
<?php echo $this->getChildHtml('blog.post.bottom') ?>
</div>
</div>
</div>
<?php if ($_stickyProgress || $_shareSticky) { echo $this->getChildBlock( "blog.post.ox_sticky" )->toHtml(); } ?>
@@ -0,0 +1,127 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
*
* Glory to Ukraine! Glory to the heroes!
*/
?>
<?php
/**
* Blog post comments template
*
* @var $block \Magefan\Blog\Block\Post\View\Comments
*/
?>
<?php
$comments = $block->getCommentsCollection();
$numberOfCommentsToDisplay = $block->getNumberOfComments();
$session = $block->getCustomerSession();
$canPost = $block->canPost();
?>
<div id="post-comments">
<div class="c-count"><?php echo __('%1 Comment(s)', $comments->getSize()) ?></div>
<!-- reply form -->
<div class="c-reply cf">
<?php if ($image = $block->getCustomerImage()) { ?>
<div class="c-img">
<img src="<?php echo $block->escapeUrl($image) ?>" alt="<?php echo $block->escapeHtml($block->getCustomerName()) ?>">
</div>
<?php } ?>
<div class="c-replyform <?php if ($canPost) echo 'no-active' ?>">
<form action="<?php echo $block->getFormUrl() ?>" method="post" data-mage-init='{"validation":{}}'>
<?php echo $block->getBlockHtml('formkey') ?>
<input type="hidden" name="post_id" value="<?php echo $block->getPost()->getId() ?>" />
<textarea name="text" placeholder="<?php echo $canPost ? __('Add a comment...') : __('Sign in to add a comment...') ?>" <?php if (!$canPost) {?>disabled="disabled"<?php } ?> data-validate="{required:true}"></textarea>
<div class="c-btn-hld">
<?php if ($canPost && !$session->getCustomerGroupId()) { ?>
<div class="lr-hld">
<div class="left-hld">
<input type="text" name="author_nickname" value="" placeholder="<?php echo __('Full Name') ?>" class="input-text required-entry" data-validate="{required:true}" autocomplete="off" aria-required="true">
</div>
<div class="right-hld">
<input type="email" name="author_email" autocomplete="email" value="" placeholder="<?php echo __('Email') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}" aria-required="true">
</div>
</div>
<?php } ?>
<?php if ($canPost) { ?>
<button type="submit"><?php echo __('Submit') ?></button>
<?php } else { ?>
<button type="button" onclick="window.location='<?php echo $block->getCustomerUrl()->getLoginUrl() ?>';"><?php echo __('Sign In') ?></button>
<?php } ?>
<?php if ($block->displayPrivacyPolicyCheckbox()) { ?>
<?= $block->getChildBlock('display_privacy_policy_checkbox')->setCommentType('post')->toHtml(); ?>
<?php } ?>
<div class="clearfix"></div>
<?= $block->getChildHtml('blog.post.comments.magefan.additional'); ?>
</div>
</form>
</div>
</div>
<?php
$commentsCount = count($comments);
if ($commentsCount) {
?>
<!-- comments list -->
<div class="c-comments" >
<?php $i = 0 ?>
<?php foreach ($comments as $comment) { ?>
<?php
$i++;
$comment->setIsHidden($i > $numberOfCommentsToDisplay);
?>
<?php echo $block->getCommentHtml($comment) ?>
<?php } ?>
<?php if ($commentsCount > $numberOfCommentsToDisplay) { ?>
<a href="#" class="c-allcomments button more-comments-action" data-comment="0"><?php echo __('Load more comments') ?></a>
<?php } ?>
</div>
<!-- reply comment form -->
<div id="c-replyform-comment" class="c-replyform c-replyform-comment" style="display:none">
<form action="<?php echo $block->getFormUrl() ?>" method="post" data-mage-init='{"validation":{}}'>
<?php echo $block->getBlockHtml('formkey') ?>
<input type="hidden" name="post_id" value="<?php echo $block->getPost()->getId() ?>" />
<input type="hidden" name="parent_id" value="" />
<textarea class="refresh-value" name="text" placeholder="<?php echo $canPost ? __('Add a reply...') : __('Sign in to add a comment...') ?>" <?php if (!$canPost) {?>disabled="disabled"<?php } ?> data-validate="{required:true}"></textarea>
<div class="c-btn-hld">
<?php if ($canPost && !$session->getCustomerGroupId()) { ?>
<div class="lr-hld">
<div class="left-hld">
<input type="text" name="author_nickname" value="" placeholder="<?php echo __('Full Name') ?>" class="input-text required-entry refresh-value" data-validate="{required:true}" autocomplete="off" aria-required="true">
</div>
<div class="right-hld">
<input type="email" name="author_email" autocomplete="email" value="" placeholder="<?php echo __('Email') ?>" class="input-text required-entry refresh-value" data-validate="{required:true, 'validate-email':true}" aria-required="true">
</div>
</div>
<?php } ?>
<button type="button" class="cancel reply-cancel-action" ><?php echo __('Cancel') ?></button>
<?php if ($canPost) { ?>
<button type="submit"><?php echo __('Submit') ?></button>
<?php if ($block->displayPrivacyPolicyCheckbox()) { ?>
<?= $block->getChildBlock('display_privacy_policy_checkbox')->setCommentType('comment')->toHtml(); ?>
<?php } ?>
<?php } else { ?>
<?php if ($block->displayPrivacyPolicyCheckbox()) { ?>
<?= $block->getChildBlock('display_privacy_policy_checkbox')->setCommentType('comment')->toHtml(); ?>
<?php } ?>
<button type="button" onclick="window.location='<?php echo $block->getCustomerUrl()->getLoginUrl() ?>';"><?php echo __('Sign In') ?></button>
<?php } ?>
<div class="clearfix"></div>
</div>
</form>
</div>
<?php } ?>
</div>
<script type="text/x-magento-init">
{
"#post-comments": {
"Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout() ?>
}
}
</script>
@@ -0,0 +1,56 @@
<?php
/**
* Copyright © Magefan (support@magefan.com). All rights reserved.
* See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
*
* Glory to Ukraine! Glory to the heroes!
*/
?>
<?php
/**
* Blog post comments template
*
* @var $block \Magefan\Blog\Block\Post\View\Comments\Magefan\Comment
*/
?>
<?php
$comment = $block->getComment();
$numberOfCommentsToDisplay = $block->getNumberOfReplies();
?>
<div class="c-comment c-comment-parent-<?php echo (int)$comment->getParentId() ?>" <?php if ($comment->getIsHidden()) echo 'style="display:none"' ?>>
<?php if ($authorImage = $comment->getAuthorImage()) { ?>
<div class="c-img">
<img src="<?php echo $authorImage ?>" alt="<?php echo $block->escapeHtml($comment->getAuthorName()) ?>">
</div>
<?php } ?>
<div class="c-post c-post-<?php echo $comment->getId() ?>" id="c-post-<?php echo $comment->getId() ?>">
<div class="p-name"><?php echo $block->escapeHtml($comment->getAuthor()->getNickname()) ?></div>
<div class="p-text"><?php echo nl2br($block->escapeHtml($comment->getText())) ?></div>
<div class="p-actions">
<a href="#" class="reply-action" data-comment="<?php echo $comment->isReply() ? $comment->getParentId() : $comment->getId() ?>" title="<?php echo __('Reply') ?>"><?php echo __('Reply') ?></a>
<span class="publish-date"><?php echo $block->escapeHtml($comment->getPublishDate('M d, Y H:i')) ?></span>
</div>
<?php
$replies = $block->getRepliesCollection();
$commentsCount = count($replies);
if ($commentsCount) {
?>
<div class="p-replies">
<?php $i = 0 ?>
<?php foreach ($replies as $reply) { ?>
<?php
$i++;
$reply->setIsHidden($i > $numberOfCommentsToDisplay);
?>
<?php echo $block->setComment($reply)->toHtml() ?>
<?php } ?>
<?php if ($commentsCount > $numberOfCommentsToDisplay) { ?>
<div class="c-more more-comments-action" data-comment="<?php echo $comment->getId() ?>">
<a href="#" class="button"><?php echo __('Show more replies in this thread') ?><i></i></a>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
@@ -0,0 +1,40 @@
<?php
/**
* Blog post next and prev post links
*
* @var $block NextPrev
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Post\View\NextPrev;
?>
<?php if ($block->displayLinks()) { ?>
<?php
$prevPost = $this->getPrevPost();
$nextPost = $this->getNextPost();
?>
<?php if ($prevPost || $nextPost) { ?>
<div class="post-nextprev-hld clearfix">
<?php if ($prevPost) { ?>
<?php $title = $block->escapeHtml($prevPost->getTitle()) ?>
<a class="nextprev-link prev-link" href="<?php echo $block->escapeUrl($prevPost->getPostUrl()) ?>" title="<?php echo __('Read %1',$title) ?>">
<span class="h6 label"><?php echo __('Previous') ?></span>
<span class="h3"><span><?php echo $title ?></span></span>
</a>
<?php } ?>
<?php if ($nextPost) { ?>
<?php $title = $block->escapeHtml($nextPost->getTitle()) ?>
<a class="nextprev-link next-link" href="<?php echo $block->escapeUrl($nextPost->getPostUrl()) ?>" title="<?php echo __('Read %1',$title) ?>">
<span class="h6 label"><?php echo __('Next') ?></span>
<span class="h3"><span><?php echo $title ?></span></span>
</a>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
@@ -0,0 +1,77 @@
<?php
/**
* Blog related posts template
*
* @var $block \Magefan\Blog\Block\Post\View\RelatedPosts
* @var $block RelatedPosts
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Catalog\Product\RelatedPosts;
$at_settings = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings');
$iWidth = $at_settings['blog_post']['related_image_width'];
$iHeight = $at_settings['blog_post']['related_image_height'];
$_hideCategories = $at_settings['blog']['blog_list_categories'];
$_relatedColumns = $at_settings['blog_post']['related_columns'];
$_relatedTitleHide = $at_settings['blog_post']['related_title_hide'];
if(!$_relatedColumns) {
$_relatedColumns = 3;
}
?>
<?php if ($block->displayPosts()) { ?>
<?php $_postCollection = $block->getPostCollection(); ?>
<?php if ($_postCollection->count()) { ?>
<div class="block related">
<?php if (!$_relatedTitleHide) { ?>
<div class="block-title title">
<strong id="block-relatedposts-heading" role="heading" aria-level="2">
<?php echo __('Related Posts') ?>
</strong>
</div>
<?php } ?>
<div class="post-list columns-<?= $_relatedColumns ?> blog-style-modern blog-list--image-top">
<?php foreach ($_postCollection as $_post) { ?>
<article class="post-holder">
<?php if($iWidth && $iHeight) {
$featuredImage = $_post->getFeaturedImage([$iWidth, $iHeight]);
} else {
$featuredImage = $_post->getFeaturedImage();
} ?>
<?php if ($featuredImage) { ?>
<a class="post-image-wrapper" href="<?php echo $block->escapeUrl($_post->getPostUrl()) ?>" title="<?php echo $block->escapeHtml($_post->getTitle()) ?>">
<img src="<?php echo $block->escapeUrl($featuredImage) ?>" alt="<?php echo $block->escapeHtml($_post->getTitle()) ?>" />
</a>
<?php } ?>
<div class="post-content">
<?php if(!$_hideCategories) {
$_categoriesCount = $_post->getCategoriesCount();
?>
<?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 } ?>
<h3 class="post-title">
<a class="post-item-link"
href="<?php echo $block->escapeUrl($_post->getPostUrl()) ?>">
<?php echo $block->escapeHtml($_post->getTitle()); ?>
</a>
</h3>
</div>
</article>
<?php } ?>
</div>
</div>
<?php } ?>
<?php } ?>
@@ -0,0 +1,87 @@
<?php
/**
* Blog related posts template
*
* @var $block \Magefan\Blog\Block\Post\View\RelatedPosts
* @var $block RelatedPosts
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
use Magefan\Blog\Block\Catalog\Product\RelatedPosts;
$at_settings = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings');
$iWidth = $at_settings['blog_product_page']['related_image_width'] ?: $at_settings['blog_post']['related_image_width'];
$iHeight = $at_settings['blog_product_page']['related_image_height'] ?: $at_settings['blog_post']['related_image_height'];
$_hideCategories = $at_settings['blog_product_page']['hide_categories'];
$hide_image = $at_settings['blog_product_page']['hide_image'];
$relatedColumns = $at_settings['blog_product_page']['related_columns'] ?: $at_settings['blog_post']['related_columns'];
$_relatedTitleHide = $at_settings['blog_product_page']['related_title_hide'];
if(!$relatedColumns) {
$relatedColumns = 3;
}
$blog_related_layout = $at_settings['blog_product_page']['blog_related_layout'] ? '-list-view' : 'blog-list--image-top';
if($at_settings['blog_product_page']['blog_related_layout']){
$_relatedColumns = '';
} else {
$_relatedColumns = 'columns-' . $relatedColumns;
}
if($blog_related_layout && $hide_image) {
$blog_related_layout = 'ox-blog-widget__titles-only';
}
?>
<?php if ($block->displayPosts()) { ?>
<?php $_postCollection = $block->getPostCollection(); ?>
<?php if ($_postCollection->count()) { ?>
<div class="block related">
<?php if (!$_relatedTitleHide) { ?>
<div class="block-title title">
<strong id="block-relatedposts-heading" role="heading" aria-level="2">
<?php echo __('Related Posts') ?>
</strong>
</div>
<?php } ?>
<div class="post-list <?= $_relatedColumns ?> blog-style-modern <?= $blog_related_layout ?>">
<?php foreach ($_postCollection as $_post) { ?>
<article class="post-holder">
<?php if($iWidth && $iHeight && !$hide_image) {
$featuredImage = $_post->getFeaturedImage([$iWidth, $iHeight]);
} else {
$featuredImage = $_post->getFeaturedImage();
} ?>
<?php if ($featuredImage && !$hide_image) { ?>
<a class="post-image-wrapper" href="<?php echo $block->escapeUrl($_post->getPostUrl()) ?>" title="<?php echo $block->escapeHtml($_post->getTitle()) ?>">
<img src="<?php echo $block->escapeUrl($featuredImage) ?>" alt="<?php echo $block->escapeHtml($_post->getTitle()) ?>" />
</a>
<?php } ?>
<div class="post-content">
<?php if(!$_hideCategories) {
$_categoriesCount = $_post->getCategoriesCount();
?>
<?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 } ?>
<h3 class="post-title">
<a class="post-item-link"
href="<?php echo $_post->getPostUrl() ?>">
<?php echo $block->escapeHtml($_post->getTitle()); ?>
</a>
</h3>
</div>
</article>
<?php } ?>
</div>
</div>
<?php } ?>
<?php } ?>
@@ -0,0 +1,414 @@
<?php
/**
* Blog related posts template
*
* @var $block \Magefan\Blog\Block\Post\View\RelatedProducts
*
* @category Olegnax
* @package Olegnax_Athlete2
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
?>
<?php
if ($exist = $block->getItems()->getSize() && $this->displayProducts()) {
$theme_helper = $this->helper('Olegnax\Athlete2\Helper\ProductList');
$at_settings = $theme_helper->getConfig('athlete2_settings');
$width = $at_settings[ 'product_images' ][ 'listing_image_width' ];
$height = $at_settings[ 'product_images' ][ 'listing_image_height' ];
$cartIcon = '<svg xmlns="http://www.w3.org/2000/svg" class="minicart-icon-1" width="14" height="16" viewBox="0 0 14 16">
<path d="M11,3V0H3V3H0V16H14V3H11ZM5,2H9V3H5V2Zm7,12H2V5H3V7H5V5H9V7h2V5h1v9Z"></path>
</svg>';
$compareIcon ='<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16">
<g>
<polygon points="2 2 8 2 8 0 0 0 0 12 3 12 3 10 2 10 2 2"></polygon>
<rect x="8" y="2" width="2" height="1"></rect>
<polygon points="13 6 13 14 6 14 6 6 13 6 13 4 4 4 4 16 15 16 15 6 13 6"></polygon>
</g>
</svg>';
$type = 'related';
$class = $type;
$image = 'related_products_list';
$image_hover = 'category_page_grid_hover';
$title = __('Related Products');
$items = $block->getItems();
$limit = 0;
$shuffle = 0;
$canItemsAddToCart = true;
$showRating = $at_settings['products_listing']['rating'];
$showPrice = $at_settings['products_listing']['price'];
$showCart = $at_settings['products_listing']['add_to_cart'];
$showWishlist = $at_settings['products_listing']['wishlist'];
$showCompare = $at_settings['products_listing']['compare'];
$showCategory = $at_settings['products_listing']['category_name'];
$showQuickview = $at_settings['products_listing']['quickview'] && $theme_helper->isActivePlugin( 'Olegnax_Quickview' );
$gridLayout = $at_settings['products_listing']['products_layout'];
$showBrand = $at_settings['products_listing']['brand'];
$showReviewCount = $at_settings['products_listing']['review_count'];
$alignDetailsCenter = $at_settings['products_listing']['products_layout_centered'];
$quickviewPosition = $at_settings['products_listing']['quickview_position'];
if($showBrand){
$brandImageSize ='';
$altBrandImage = !$at_settings['products_listing']['brand_image_alt'];
$brandImageWidth = $at_settings['products_listing']['brand_image_width'];
$brandImageHeight = $at_settings['products_listing']['brand_image_height'] ?: $at_settings['products_listing']['brand_image_width'];
if($brandImageWidth && $brandImageHeight) {
$brandImageSize = [$brandImageWidth, $brandImageHeight];
}
}
$classes = [];
$classes[] = 'product-columns-' . $at_settings['blog_post']['blog_related_product_columns'];
$classes[] = 'product-columns-s-' . $at_settings['products_listing']['grid_columns_s'];
$classes[] = 'product-columns-m-' . $at_settings['products_listing']['grid_columns_m'];
$classes[] = 'product-columns-l-' . $at_settings['blog_post']['blog_related_product_columns'];
$classes[] = $alignDetailsCenter ? 'align-details-center' : '';
$classes[] = $showReviewCount ? 'show-review-count' : '';
$classes[] = $quickviewPosition ? ('quickview-' . $quickviewPosition) : '';
if($gridLayout === '2'){
$classes[] = 'products-grid__layout-2';
} else {
$classes[] = 'products-grid__layout-default';
}
if($gridLayout === '5'){
$classes[] = 'secondary-top-right';
}
if($gridLayout === '4' || $gridLayout === '2' || $gridLayout === '5'){
$classes[] = 'products-grid__buttons-below';
}
$templateType = null;
$description = false;
}
?>
<?php if ($exist):?>
<?php if ($type == 'related' || $type == 'upsell'): ?>
<?php if ($type == 'related'): ?>
<div class="block <?php echo $class; ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?php echo $limit; ?>" data-shuffle="<?php echo $shuffle; ?>">
<?php else: ?>
<div class="block <?php echo $class; ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?php echo $limit; ?>" data-shuffle="<?php echo $shuffle; ?>">
<?php endif; ?>
<?php else: ?>
<div class="block <?php echo $class; ?>">
<?php endif; ?>
<div class="block-title title">
<strong id="block-<?php echo $class?>-heading" role="heading" aria-level="2"><?php echo $title; ?></strong>
</div>
<div class="block-content content" aria-labelledby="block-<?php echo $class?>-heading">
<div class="products wrapper grid products-grid products-<?php echo $type; ?> <?php echo implode( ' ', $classes ) ?>">
<ol class="products__listing-wrapper products list items product-items">
<?php $iterator = 1; ?>
<?php foreach ($items as $_item): ?>
<?php $available = ''; ?>
<?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related'): ?>
<?php if (!$_item->getRequiredOptions()): ?>
<?php $available = 'related-available'; ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($type == 'related' || $type == 'upsell'): ?>
<?php echo($iterator++ == 1) ? '<li class="item product product-item" style="display: none;">' : '</li><li class="item product product-item" style="display: none;">' ?>
<?php else: ?>
<?php echo($iterator++ == 1) ? '<li class="item product product-item">' : '</li><li class="item product product-item">' ?>
<?php endif; ?>
<div class="product-item-info <?php echo $available; ?>">
<div class="product-grid__image-wrapper">
<?= /* @escapeNotVerified */ '<!-- ' . $image . '-->' ?>
<a href="<?= /* @escapeNotVerified */ $block->getProductUrl($_item) ?>" class="product photo product-item-photo">
<?= $this->helper( 'Olegnax\Athlete2\Helper\ProductImage' )->getResizedImageHover($_item, $image, $image_hover, [$width, $height] )->toHtml(); ?>
</a>
<?php if($gridLayout === '2') { ?>
<?php if ($showCart || $showQuickview): ?>
<div class="product-item-inner">
<div class="product actions product-item-actions">
<div class="actions-primary">
<?php if ( $_item->isSaleable() && $showCart ): ?>
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)): ?>
<button class="action tocart primary"
data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
type="button"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else: ?>
<?php $postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()]);
?>
<button class="action tocart primary"
data-post='<?= $block->escapeHtml($postData); ?>'
type="button" title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<?= $cartIcon ?><span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php endif; ?>
<?php else: ?>
<?php if ($_item->getIsSalable()): ?>
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
<?php else: ?>
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php
if ( $showQuickview ) {
echo $this->helper( 'Olegnax\Quickview\Helper\Helper' )->getButton( $_item, 'button quick-view' );
}
?>
</div>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="overlay-link"></a>
</div>
<?php endif; ?>
<?php } elseif($gridLayout === '3') { ?>
<?php if ($showCompare || $showWishlist || $showQuickview): ?>
<div class="product-item-inner">
<div class="product actions product-item-actions">
<?php if ($showCompare || $showWishlist): ?>
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#" data-post='<?php echo $block->getAddToWishlistParams($_item); ?>' class="action towishlist" data-action="add-to-wishlist" title="<?php echo __('Add to Wish List') ?>">
<span><?php echo __('Add to Wish List') ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php
$compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
?>
<a href="#" class="action tocompare"
data-post='<?php echo $compareHelper->getPostDataParams($_item);?>'
data-role="add-to-links"
title="<?php echo __('Add to Compare'); ?>">
<span class="icon" style="height:auto;"><?= $compareIcon ?></span><span><?php echo __('Add to Compare') ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php
if ( $showQuickview ) {
echo $this->helper( 'Olegnax\Quickview\Helper\Helper' )->getButton( $_item, 'button quick-view' );
}
?>
</div>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="overlay-link"></a>
</div>
<?php endif; ?>
<?php } elseif($gridLayout === '4') { ?>
<?php if ($showQuickview): ?>
<div class="product-item-inner">
<?php echo $this->helper( 'Olegnax\Quickview\Helper\Helper' )->getButton( $_item, 'button quick-view' ); ?>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="overlay-link"></a>
</div>
<?php endif; ?>
<?php } elseif($gridLayout === '5') { ?>
<?php if ($showCompare || $showWishlist || $showQuickview): ?>
<div class="product-item-inner">
<?php if ($showCompare || $showWishlist): ?>
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#" data-post='<?php echo $block->getAddToWishlistParams($_item); ?>' class="action towishlist" data-action="add-to-wishlist" title="<?php echo __('Add to Wish List') ?>">
<span><?php echo __('Add to Wish List') ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php
$compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
?>
<a href="#" class="action tocompare"
data-post='<?php echo $compareHelper->getPostDataParams($_item);?>'
data-role="add-to-links"
title="<?php echo __('Add to Compare'); ?>">
<span class="icon"><?= $compareIcon ?></span><span><?php echo __('Add to Compare') ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php
if ( $showQuickview ) {
echo $this->helper( 'Olegnax\Quickview\Helper\Helper' )->getButton( $_item, 'button quick-view' );
}
?>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="overlay-link"></a>
</div>
<?php endif; ?>
<?php } else { ?>
<?php if ($showCompare || $showCart || $showWishlist || $showQuickview): ?>
<div class="product-item-inner">
<div class="product actions product-item-actions">
<div class="actions-primary">
<?php if ( $_item->isSaleable() && $showCart ): ?>
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)): ?>
<button class="action tocart primary"
data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
type="button"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else: ?>
<?php $postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()]);
?>
<button class="action tocart primary"
data-post='<?= $block->escapeHtml($postData); ?>'
type="button" title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<?= $cartIcon ?><span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php endif; ?>
<?php else: ?>
<?php if ($_item->getIsSalable()): ?>
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
<?php else: ?>
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
<?php endif; ?>
<?php endif; ?>
<?php if ($showCompare || $showWishlist): ?>
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
<?php if ($addToBlock = $block->getChildBlock('addto')): ?>
<?= $addToBlock->setProduct($_item)->getChildHtml() ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php
if ( $showQuickview ) {
echo $this->helper( 'Olegnax\Quickview\Helper\Helper' )->getButton( $_item, 'button quick-view' );
}
?>
</div>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="overlay-link"></a>
</div>
<?php endif; ?>
<?php } ?>
<?php if ( $theme_helper->isActivePlugin( 'Olegnax_ProductLabel' ) ) {
echo $this->helper( 'Olegnax\ProductLabel\Helper\Helper' )->showLabels( $_item );
} ?>
</div>
<div class="product-grid-overlay"></div>
<div class="product details product-item-details">
<?php if($gridLayout === '2') { ?>
<?php if ($showWishlist || $showCompare): ?>
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#" data-post='<?php echo $block->getAddToWishlistParams($_item); ?>' class="action towishlist" data-action="add-to-wishlist" title="<?php echo __('Add to Wish List') ?>">
<span><?php echo __('Add to Wish List') ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php
$compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
?>
<a href="#" class="action tocompare"
data-post='<?php echo $compareHelper->getPostDataParams($_item);?>'
data-role="add-to-links"
title="<?php echo __('Add to Compare'); ?>">
<span class="icon"><?= $compareIcon ?></span><span><?php echo __('Add to Compare') ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php } ?>
<strong class="product name product-item-name"><a class="product-item-link" title="<?php echo $block->escapeHtml($_item->getName()) ?>" href="<?php echo $block->getProductUrl($_item) ?>">
<?php echo $block->escapeHtml($_item->getName()) ?></a>
</strong>
<?php if ( $showPrice ) { echo /* @escapeNotVerified */ $block->getProductPrice($_item); } ?>
<?php if ($templateType && $showRating): ?>
<?php echo $block->getReviewsSummaryHtml($_item, $templateType) ?>
<?php endif; ?>
<?php if($gridLayout === '4') { ?>
<div class="product actions product-item-actions">
<?php if ( $_item->isSaleable() && $showCart ): ?>
<div class="actions-primary">
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)): ?>
<button class="action tocart primary"
data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
type="button"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else: ?>
<?php $postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()]);
?>
<button class="action tocart primary"
data-post='<?= $block->escapeHtml($postData); ?>'
type="button" title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<?= $cartIcon ?><span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php endif; ?>
</div>
<?php else: ?>
<?php if ($_item->getIsSalable()): ?>
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
<?php else: ?>
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
<?php endif; ?>
<?php endif; ?>
<?php if ($showCompare || $showWishlist): ?>
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#" data-post='<?php echo $block->getAddToWishlistParams($_item); ?>' class="action towishlist" data-action="add-to-wishlist" title="<?php echo __('Add to Wish List') ?>">
<span><?php echo __('Add to Wish List') ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php
$compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
?>
<a href="#" class="action tocompare"
data-post='<?php echo $compareHelper->getPostDataParams($_item);?>'
data-role="add-to-links"
title="<?php echo __('Add to Compare'); ?>">
<span class="icon"><?= $compareIcon ?></span><span><?php echo __('Add to Compare') ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php } ?>
<?php if($gridLayout === '3' || $gridLayout === '5') { ?>
<div class="product actions product-item-actions">
<?php if ( $_item->isSaleable() && $showCart ): ?>
<div class="actions-primary">
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)): ?>
<button class="action tocart primary"
data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
type="button"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php else: ?>
<?php $postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()]);
?>
<button class="action tocart primary"
data-post='<?= $block->escapeHtml($postData); ?>'
type="button" title="<?= $block->escapeHtml(__('Add to Cart')) ?>">
<?= $cartIcon ?><span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
</button>
<?php endif; ?>
</div>
<?php else: ?>
<?php if ($_item->getIsSalable()): ?>
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
<?php else: ?>
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php } ?>
</div>
</div>
<?php echo($iterator == count($items)+1) ? '</li>' : '' ?>
<?php endforeach ?>
</ol>
</div>
</div>
</div>
<?php endif;?>
@@ -0,0 +1,64 @@
<?php
/**
* Blog sidebar posts list template
*
* @var $block AbstractList
*/
use Magefan\Blog\Block\Post\PostList\AbstractList;
use Magefan\Blog\Helper\Image;
?>
<?php
$_postCollection = $block->getPostCollection();
?>
<?php
$athleteHelper = $this->helper('Olegnax\Athlete2\Helper\Helper')->getConfig('athlete2_settings/blog');
$showImage = $athleteHelper['blog_sidebar_recent_image'];
if($showImage){
$width = (int)($athleteHelper['blog_sidebar_recent_image_width'] ?: 300);
$height = (int)($athleteHelper['blog_sidebar_recent_image_height'] ?: 200);
}
$imageHelper = $this->helper( Image::class);
?>
<?php if ($_postCollection->count()) { ?>
<div class="widget block block-<?= $block->escapeHtml(str_replace('_', '-', $block->getWidgetKey())) ?> block-list-posts" >
<div class="block-title">
<strong><?= $block->escapeHtml(__($block->getBlockTitle() ?: 'Recent Posts')) ?></strong>
</div>
<div class="block-content">
<?php foreach ($_postCollection as $_post) { ?>
<?php
$_postUrl = $block->escapeUrl($_post->getPostUrl());
$_postName = $block->escapeHtml($_post->getTitle());
$featuredImage = $_post->getFeaturedListImage() ?: $_post->getFeaturedImage();
?>
<div class="item clearfix <?php if ($showImage) { echo 'with-image'; } ?>">
<?php if ($featuredImage && $showImage) { ?>
<div class="post-image">
<?php
$featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt');
if (!$featuredImgAlt) {
$featuredImgAlt = $_postName;
}
?>
<a class="post-item-link" title="<?= $_postName ?>" href="<?= $_postUrl ?>">
<img data-width-amp="<?= $width ?>" data-height-amp="<?= $height ?>" layout="responsive" src="<?= $imageHelper->init($_post->getFeaturedListImg() ?: $_post->getFeaturedImg())->resize($width, $height); ?>"
alt="<?= $block->escapeHtml($featuredImgAlt) ?>" />
</a>
</div>
<?php } ?>
<?php if ($featuredImage && $_post->isPublishDateEnabled()) { ?>
<div class="post-item-date">
<span class="value"><?= $block->escapeHtml($_post->getPublishDate()) ?></span>
</div>
<?php } ?>
<a class="post-item-link" title="<?= $_postName ?>" href="<?= $_postUrl ?>">
<?= $_postName ?>
</a>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
@@ -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 } ?>
@@ -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 } ?>
@@ -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 } ?>
@@ -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 } ?>
@@ -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 } ?>