Answer the question
In order to leave comments, you need to log in
How to split leading into several different parts with your markup?
Hello everyone !
There is a code (blog.php file) that is responsible for displaying the introductory text, image, etc. of the article in full width:
<?php if (!empty($this->lead_items)) : ?>
<div class="items-leading clearfix">
<?php foreach ($this->lead_items as &$item) : ?>
<div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
<?php $leadingcount++; ?>
<?php endforeach; ?>
</div>
<?php endif;
<?php if (!empty($this->intro_items)) : ?>
<?php foreach ($this->intro_items as $key => &$item) : ?>
<?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?>
<?php if ($rowcount === 1) : ?>
<?php $row = $counter / $this->columns; ?>
<div class="items-row cols-<?php echo (int) $this->columns; ?> <?php echo 'row-' . $row; ?> row-fluid clearfix">
<?php endif; ?>
<div class="span<?php echo round(12 / $this->columns); ?>">
<div class="item column-<?php echo $rowcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
<?php $counter++; ?>
</div>
<?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif;
Answer the question
In order to leave comments, you need to log in
As always, everything turned out to be as simple as possible!
In the above code (last code in the first post) of the blog.php file, in
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
<?php
$myarr = array_slice($this->intro_items, 3);
foreach ($myarr_items as $key => &$item) :
?>
<?php if (!empty($this->intro_items)) :
$myarr = array_slice($this->intro_items, 0, 3);
foreach ($myarr as $key => &$item) :
$this->item = &$item;
echo $this->loadTemplate('item');
endforeach;
endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question