R
R
Roman Progressive2018-10-18 04:31:23
JavaScript
Roman Progressive, 2018-10-18 04:31:23

How to display all AJAX news on button click?

Hi all!

through bootstrap tabs displayed news on the main page
Tab - Category 1

{custom category="1,2,3" template="shortstory" order="title" sort="desc" limit="15"}


Tab - Category 2
{custom category="4" template="shortstory" order="title" sort="desc" limit="15"}


Tab - Category 3
{custom category="5" template="shortstory" order="title" sort="desc" limit="15"}


how to make it so that 15 news are displayed,
and then show 15 more news, when you press the button, 15 more news are displayed.
And if all the news are displayed, then the buttons are not visible!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ihor Bratukh, 2018-10-18
@Pro-gressive

You need to edit cms, php, sql queries, but if it's simple, then install the module: BlockPRO

R
Roman Progressive, 2018-10-18
@Pro-gressive

Under each "custom" add another "custom", without the limit parameter, but with the from parameter. We put each new tag in a hidden div-container, next to the button for display.
Example for first tab, need jquery

{custom category="1,2,3" template="shortstory" order="title" sort="desc" limit="15"}
<br />
<button onclick="$(this).next('div').show()">Показать все</button>
<div style="display:none">
{custom category="1,2,3" template="shortstory" order="title" sort="desc" from="15"}
</div>

did like this, well, at the same time, it is necessary that the button disappear if all the news are displayed, and there is nothing more to show!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question