Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-04-17 02:50:23

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 196
Website

Re: How to load more articles with Ajax

Hi. Three years later I have the same situation:

When I click the “Load more” button, I go to the page 2, instead of loading the next two articles below the articles.

<div class="col-12 col-lg-8 col-xl-9">
	<div class="grid loadmore" data-masonry='{ "itemSelector": ".grid-item", "columnWidth": ".grid-sizer", "gutter": ".gutter-sizer", "percentPosition": true, "transitionDuration": "0.3s" }'>
		<txp:article_custom offset='<txp:etc_offset pgcounter="page" pageby="2" />' pgonly="0" section="blog" limit="2" form="blog" />
		<div class="grid-sizer"></div>
		<div class="gutter-sizer"></div>
	</div>
	<p class="extra-margin-bottom text-center">
		<txp:etc_pagination pages='<txp:etc_numpages section="blog" limit="2" />' mask="{next}" range="0" pgcounter="page" next="<a href='{href}' class='more button white big'>Load more&hellip;</a>"/>
		<script type="text/javascript">
	    	$('.loadmore').jscroll({
	    	autoTrigger: false,
	    	nextSelector: 'a.more',
	    	contentSelector: 'div.loadmore>*'
		});
		</script>
	</p>
</div>

I have @<txp:etc_pagination> plugin installed. What am I missing?

Thank you in advance.

Offline

#12 2018-04-18 01:52:11

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 196
Website

Re: How to load more articles with Ajax

Hi again, to make it clear, here is the link: http://anden.pe/blog/. Once you click on “Cargar más” (Load more) button, you are moved to page2, instead of loading the remaining articles below…. Any ideas?

Thank you

Offline

#13 2018-04-18 08:20:10

etc
Developer
Registered: 2010-11-11
Posts: 2,697
Website

Re: How to load more articles with Ajax

Hi, check i your browsers console if jQuery is loaded before the scroll script.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#14 2018-04-18 08:33:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,310
Website

Re: How to load more articles with Ajax

You seem to be loading the jscroll script twice – once in the head and once lower down, which might be having some bearing on what etc says. jQuery is “not found” according to the inspector.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#15 2018-04-18 17:07:21

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 196
Website

Re: How to load more articles with Ajax

Hi etc and Bloke. Thank you for your time. I have the jquery and jscroll javascript files only on top. But still nothing changes. On the inspector I see not error or warnings.

Something I am missing, but I don’t know what. Still I need help :)

Offline

#16 2018-04-18 20:48:52

etc
Developer
Registered: 2010-11-11
Posts: 2,697
Website

Re: How to load more articles with Ajax

Weird. Could it be that .more trigger must be inside .loadmore? I have no experience with jScroll and a very limited internet connection atm, sorry.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#17 2018-04-19 22:42:34

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 196
Website

Re: How to load more articles with Ajax

Hi guys. I am lost again… any way, what I want is to load more articles once I click on “load more articles”. I don’t know if there is another easier way. Any ideas? Thank you.

Offline

Board footer

Powered by FluxBB