H
H
hocesunoc2016-02-16 14:48:14
Drupal
hocesunoc, 2016-02-16 14:48:14

How to make ajax pagination in drupal views without using the < a > tag?

I have a drupal page with 2 views inserted:
The first one displays annotations of the main news and should have normal pagination.
The second one is in the sidebars and displays the latest news.
I wanted to attach the "load more" link to the second view, for this I use the "Views Show More" module. The "views ajax history" module is also connected.
But it's bad luck - with this configuration, 2 appear on the page (or more if the view is larger) paginator, which is no good.
Pagination links start to look something like this:
site.ru/news?page=2,3,0,4 which does not suit me.
Tell me, please, is it possible to replace the link of the paginator with <span> in the secondary view in the sidebar so that Yandex does not index it and make it so that "views ajax history" does not add it to the url when switching pages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shcherbakov, 2016-02-16
@WestTrade

<div class="content"></div>
<span class="loadMore">Тырк!</span>

$('html').on('click','.loadMore',function() {
  // 1. запрашиваем сервер $.ajax методом
  // 2. что-то получаем от сервера, заносим в переменную (если сервер отдает HTML)
  $('.content').append('переменная с ответом от сервера'); // 3. вставляем результат
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question