Answer the question
In order to leave comments, you need to log in
How to change the order of elements in the news.list component like in Ya.Zen?
Good evening!
A page with a list of articles, taken from the infoblock https://www.decorbazar.ru/stati/
The customer wanted the order to be like on Ya Zen https://zen.yandex.ru/
I assume that logic is needed through result_modifier.php change, but I would like to listen to experienced developers, maybe someone who already had experience, please share :-)
Answer the question
In order to leave comments, you need to log in
result_modifier.php
no need to touch.
In template.php
, in the cycle where the news is displayed, where you are now col-md-12
, write down the condition that for every fourth you put down the class col-md-8
, after for the third in a row col-md-8
, for all the rest col-md-4
. What would happen like this:
<div class="col-md-4">
<div class="col-md-4">
<div class="col-md-4">
<div class="col-md-8"><!-- четвёртый -->
<div class="col-md-4">
<div class="col-md-4">
<div class="col-md-8"><!-- третий -->
<div class="col-md-4">
<div class="col-md-4">
<div class="col-md-4">
<div class="col-md-8"><!-- четвёртый -->
<div class="col-md-4">
<div class="col-md-4">
<div class="col-md-8"><!-- третий -->
<div class="col-md-4">
<div class="col-md-4">
<!-- и т.д. -->
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question