Hello. It was necessary to add an arbitrary container to the site display template. Below is attached a schematic illustration for clarity and a code snippet. At the moment, the elements are displayed as follows: photo 1

It is necessary to implement the addition of a custom container, for example, after material 6 as follows:

photo 2

Here is a snippet of code that is responsible for displaying materials:

<?php if(count($this->items)): ?> <div class="tagItemList"> <?php foreach($this->items as $item): ?> 

Through the admin panel indicates the number of displayed materials on the page (in this case, it is 12). Accordingly, there is a pagination.

 <!-- Pagination --> <?php if($this->pagination->getPagesLinks()): ?> <div class="k2Pagination"> <?php echo $this->pagination->getPagesLinks(); ?> <div class="clr"></div> <?php/* echo $this->pagination->getPagesCounter();*/ ?> </div> <?php endif; ?> 

Please tell me how to make the custom DIV displayed on the position after material 6 on each pagination page. Thank!

  • do not complicate. just insert a new element in the source data array at the desired position. - vitidev
  • but how to do it ? - Ivan
  • one
    I find it difficult to understand your difficulties. This problem has 2 options: 1) a head-on option (govnokod). right when displaying the list in html, we start a variable counter (for loop) and if $ i == 6, then we insert our block instead of the list one and do $ i-- 2) there is data, there is a method of drawing data into a table that can make a table from any amount of data (elementary). we introduce the concept of "element type" and "render the table" simply checks "if this is the type of element, then we draw like this." We modify the data array at will, and the render just draws - vitidev
  • I understand that this is elementary, but the fact is that I am not strong in this matter. Therefore, I tried to ask the question as much as possible in order to get, as far as possible, a detailed answer. Thank. - Ivan

0