<?php $portfolios = $this->getCurrentPortfolios() ?>
<div class="portfolio-container">
	<?php if(count($portfolios)>0): ?>
		<?php $helper = $this->helper('MGS\Portfolio\Helper\Data') ?>
		<div class="row portfolio-grid">
			<?php $i=0; foreach($portfolios as $portfolio): $i++; ?>
					<div class="col-md-4 col-sm-4 col-12">
						<?php $thumbnailUrl = $this->getThumbnailSrc($portfolio) ?>
						<?php $portfolioUrl = $this->getPortfolioAddress($portfolio) ?>
						<div class="portfolio-item">
							<div class="portfolio-top-content">
								<a href="<?php echo $portfolioUrl; ?>"><img src="<?php echo $thumbnailUrl ?>" alt="<?php echo $portfolio->getName() ?>" class="img-fluid"/></a>
							</div>
							<div class="portfolio-bottom-content">
								<h4><a href="<?php echo $portfolioUrl; ?>"><?php echo $portfolio->getName() ?></a></h4>
								
								<p class="category-link"><?php echo $this->getCategoriesLink($portfolio)?></p>
								
								<div class="short-content">
									<?php echo $this->truncate($portfolio->getDescription(), 150); ?>
								</div>
							</div>
						</div>
					</div>
					<?php if($i % 3 == 0): ?>
						<div class="clearfix"></div>
					<?php endif ?>
			<?php endforeach ?>
		</div>
	<?php else: ?>
		<p class="note-msg"><?php echo __('There are no portfolios matching the selection.') ?></p>
	<?php endif ?>
</div>