By applestalk on Tuesday, 27 June 2017
Posted in General Issues
Likes 0
Views 336
Votes 0
Is it possible to get a simple grid layout, without any magazine or showcase item?
Hm, if that is the case, you could edit the theme file /components/com_easyblog/themes/wireframe/blogs/grid/default.php and remove the codes from line 16 - 101 respectively,

[gist]
<?php if ($showcasePost) { ?>
<div class="eb-blog-grid--<?php echo $gridShowcaseLayout; ?>">
<div id="eb-blog-grid-showcases" class="eb-blog-grid-showcases carousel slide mootools-noconflict" data-showcasepost-posts data-interval="false">
<div class="carousel-inner">
<?php $i = 0; ?>
<?php foreach ($showcasePost as $post) { ?>
<?php ++$i;?>
<div class="item<?php echo $i == 1 ? ' active' : '';?>" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
<div class="eb-blog-grid-showcase">
<?php if ($this->params->get('photo_show', true)) { ?>
<?php if ($post->hasImage()) { ?>
<div class="eb-blog-grid-showcase-cover">
<a class="eb-blog-grid-showcase-cover__img" href="<?php echo $post->getPermalink(); ?>" style="background-image: url('<?php echo $post->getImage('large');?>');"></a>
</div>
<?php } ?>
<?php } ?>
<div class="eb-blog-grid-showcase-content<?php echo $this->params->get('photo_show', true) ? '' : ' no-cover'; ?>">
<?php if ($this->params->get('authoravatar', true)) { ?>
<a href="<?php echo $post->getAuthor()->getProfileLink(); ?>" class="showcase-avatar" itemtype="https://schema.org/ImageObject" itemscope="" itemprop="logo">
<img class="showcase-avatar--rounded" src="<?php echo $post->getAuthor()->getAvatar(); ?>" alt="<?php echo $post->getAuthor()->getName(); ?>">
<meta content="<?php echo $post->getAuthor()->getAvatar();?>" itemprop="url">
<meta content="50" itemprop="width">
<meta content="50" itemprop="height">
</a>
<?php } ?>
<a href="<?php echo $post->getPermalink(); ?>">
<h2 itemprop="name headline" class="eb-blog-grid-showcase-content__title"><?php echo $post->title;?></h2>
</a>
<div class="eb-blog-grid-showcase-content__article">
<span>
<?php echo $post->getIntro(true, $showcaseTruncation, 'intro', null, array('forceTruncateByChars' => true, 'forceCharsLimit' => $this->params->get('showcase_content_limit', 350))); ?>
</span>
</div>
<div class="eb-blog-grid-showcase-content__meta eb-blog-grid-showcase-content__meta--text">
<?php if ($this->params->get('contentauthor', true)) { ?>
<div class="eb-blog-grid-showcase-author" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<span itemprop="name">
<?php echo ucfirst(JText::_('COM_EASYBLOG_GRID_SHOWCASE_BY')); ?><a itemprop="url" rel="author" href="<?php echo $post->getAuthor()->getProfileLink(); ?>"><?php echo $post->getAuthor()->getName(); ?></a>
</span>
</div>
<?php } ?>
<div class="eb-blog-grid-showcase-category">
<span>
<?php echo JText::_('COM_EASYBLOG_GRID_SHOWCASE_POSTED_IN'); ?><a href="<?php echo $post->getPrimaryCategory()->getPermalink();?>"><?php echo $post->getPrimaryCategory()->title;?></a>
<?php if ($this->params->get('contentdate' , true)) { ?>
<?php echo JText::_('COM_EASYBLOG_GRID_SHOWCASE_ON'); ?>
<?php echo $post->getDisplayDate()->format(JText::_('DATE_FORMAT_LC1')); ?>
<?php } ?>
</span>
</div>
</div>
<div class="eb-blog-grid-showcase-content__more">
<?php if ($this->params->get('showreadmore', true)) { ?>
<a class="showcase-btn showcase-btn-more" href="<?php echo $post->getPermalink();?>"><?php echo JText::_('COM_EASYBLOG_GRID_SHOWCASE_READ_MORE');?></a>
<?php } ?>
</div>

<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://google.com/article"/>

<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject" class="hidden">
<img src="<?php echo $post->getImage($this->config->get('cover_size', 'large'));?>" alt="<?php echo $this->html('string.escape', $post->getImageTitle());?>"/>
<meta itemprop="url" content="<?php echo $post->getImage($this->config->get('cover_size', 'large'));?>">
<meta itemprop="width" content="<?php echo $this->config->get('cover_width');?>">
<meta itemprop="height" content="<?php echo $this->config->get('cover_height');?>">
</div>

<meta itemprop="dateModified" content="<?php echo $post->getFormDateValue('modified');?>"/>
<meta itemprop="datePublished" content="<?php echo $post->getDisplayDate($this->params->get('post_date_source', 'created'))->format(JText::_('DATE_FORMAT_LC4'));?>">
</div>
</div>
</div>
<?php } ?>
</div>
<?php if (count($showcasePost) > 1) { ?>
<div class="eb-blog-grid-showcase-control btn-group">
<a class="btn btn-default btn-xs" href="#eb-blog-grid-showcases" role="button" data-bp-slide="prev">
<span class="fa fa-angle-left"></span>
</a>
<a class="btn btn-default btn-xs" href="#eb-blog-grid-showcases" role="button" data-bp-slide="next">
<span class="fa fa-angle-right"></span>
</a>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
[/gist]

This would remove the showcase portion but this also means that featured posts wouldn't show up on the grid layout though.
·
Tuesday, 27 June 2017 23:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Hm, your best bet in getting a grid layout is to use the grid layout, http://easyblog.stackideas.com/grid . Alternatively you can switch to the theme nickel which utilizes masonry to render the grid but I certainly would prefer the grid layout over masonry any time because masonry uses javascript to render the layout.
·
Tuesday, 27 June 2017 21:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

When I use the Grid Layout I get a Showcase post at the top but all I want is a simple grid.
·
Tuesday, 27 June 2017 22:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you Mark, the code change did the trick.
·
Tuesday, 27 June 2017 23:53
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Tuesday, 27 June 2017 23:56
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post