A
A
Andrey Bely2020-07-14 21:14:43
1C-Bitrix
Andrey Bely, 2020-07-14 21:14:43

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/
5f0df4abb1dc2932057607.png
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

1 answer(s)
A
Alexey Emelyanov, 2020-07-14
@babarun

result_modifier.phpno 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">
<!-- и т.д. -->

And then it's up to the layout designer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question