Page 1 of 2
Infinite posts feature / option
Posted: Thu 9. Jan 2014, 12:50
by adamderesz
Is it possible to implement somehow the 'infinite posts' option so once we open a page/section it will automatically load few articles and add more articles from that category every time we reach almost end of that page?
That would be very very useful
Re: Infinite posts feature / option
Posted: Thu 9. Jan 2014, 12:57
by Oliver Georgi
until now there is nothing like this. It might be possible in combination with pagination and javascript that handles this because there is simple solution inside of phpwcms to catch only specific content sections. Idea would be to detect pagination by javascript, sort out the possible max amount and while scrolling down load next page content by ajax and append it and so on…
All missing is the JavaScript that is fired — at all pretty simple. No JavaScript = fallback to the classic paginated method.
Re: Infinite posts feature / option
Posted: Thu 9. Jan 2014, 13:23
by update
Re: Infinite posts feature / option
Posted: Thu 9. Jan 2014, 13:44
by nameless1
in conclusion, adamderesz: if you're able to output a pagination you're able to infinit scroll
but there are only a few parts inside phpwcms with pagination, yet
other way oliver talked about would be to check
this and create your own infinit loader.
would like to see the result.
Re: Infinite posts feature / option
Posted: Thu 9. Jan 2014, 14:01
by Oliver Georgi
Re: Infinite posts feature / option
Posted: Thu 9. Jan 2014, 18:20
by nameless1
changed
Re: Infinite posts feature / option
Posted: Thu 9. Jan 2014, 18:59
by update
nameless1 wrote:would like to see the result.
Me too
and the corresponding howto
Re: Infinite posts feature / option
Posted: Fri 10. Jan 2014, 18:18
by adamderesz
Will have a think about it... slight trouble is I'm not the best javascripter in town
To tell you the truth I recently had to make a website based on 'wp' and it was so incredibly painful I regretted this job the second day it started...
Mmy customer needed to use a tool that's based on.. that something, so there was no other option. Hopefully for me it was also based on purchased template, so at the end it was not so bad, but I'll never do it again if I'm not forced to it
To the point - the cool feature there was this infinite posts, and I really liked that idea... so, we'll see
thanks for info and some draft guidelines
Adam
Re: Infinite posts feature / option
Posted: Fri 10. Jan 2014, 19:18
by Oliver Georgi
I would be able to work this out if someone needs but as always — should be paid at all (symbolic price).
Re: Infinite posts feature / option
Posted: Sat 11. Jan 2014, 11:40
by adamderesz
Soo, tried it on phpwcms 1.5.4.1 (r491), and it worked (in general) straight from the box.
Code used was Infinite Ajax Scroll (IAS) from
https://github.com/webcreate/infinite-ajax-scroll
Here's how it went:
1.
Site is using paginate code as in config/phpwcms/conf.template_default.inc.php file with added extra class for "next page' link as it's required by the IAS script to work
Code: Select all
Line 122:
$template_default['article_paginate_navi'] = '<div class="paginate paginate-{POS}">{PREV:«} <span class="page-next">{NEXT:»}</span> page # of ##</div>'; //
2.
I have the 'articles' template set, that is different to all others within the site for various reasons, and it includes jQuery (v1.7), the IAS script and then call to start IAS.
Theres' some small css provided with IAS I just placed together with my main css file. It's just to position the loading progress graphic, mainly and make nice notes (IAS script can add notes like 'no more to view' or 'hover here for more content') - I don't use that here.
The call for that lot is also straight from the box:
Code: Select all
<script type="text/javascript">
jQuery.ias({
container : '#cnt',
item: '.artlistentry',
pagination: '#cnt .paginate',
next: '.page-next a',
loader: '<img src="/img/loader.gif"/>'
});
</script>
Above call (if in-page) shall be placed after the posts area so it hides the original pagination block, if it's before - the block will be visible until first ias function trigger.
3.
Set up the article nodes of my site to use pagination and show 5 elements per page...
And it works like a gem
I'm quite sure it will work as good if used for article content pagination... so one can do a fancy self expanding article with just few clicks, literally.
I guess that could be a nice feature to implement, sometime in a future or just setup guidelines somewhere in official phpwcms docs
Re: Infinite posts feature / option
Posted: Sat 11. Jan 2014, 12:00
by update
Yeah! This sounds good (enough) to give it a try?
Will post it at the
http://www.phpwcms-howto.de/wiki/ as soon as there is some more comment by Oliver to read...
Re: Infinite posts feature / option
Posted: Sat 11. Jan 2014, 12:13
by Oliver Georgi
adamderesz wrote:Soo, tried it on phpwcms 1.5.4.1 (r491), and it worked (in general) straight from the box…
Fine and good work. That's easy at all.
Re: Infinite posts feature / option
Posted: Sat 11. Jan 2014, 12:33
by update
adamderesz wrote:
3.
Set up the article nodes of my site to use pagination and show 5 elements per page...
adamderesz wrote:
I have the 'articles' template set, that is different to all others
Could you please be so kind to provide examples of the above, for the sake of completeness?
Edit: Did you setup different articles within a level or did you use the pagination of Content Parts? Could be done with both versions, I think?
Re: Infinite posts feature / option
Posted: Sat 11. Jan 2014, 14:02
by adamderesz
claus wrote:
Could you please be so kind to provide examples of the above, for the sake of completeness?
There's nothing to add, really.
In administration, for sections that have many articles (news, events, blog name it any way you want) one must enable pagination and set it to required number of elements per page.
My 'articles template' is different only because it implements the IAS code plus {CATEGORY} as a h1 element (instead of using the regular article h1). That's because I also use additional 'news' article template - purely to have other headers formatting - different for single page and multi-articles section. It's really very site specific, so there's nothing to add to 'core instruction'
claus wrote:
Edit: Did you setup different articles within a level or did you use the pagination of Content Parts? Could be done with both versions, I think?
The test implementation I made - it's actually live client's site (
) - is using that for article list, only - as this is the place where pagination is used most often. They rarely have articles that long to make them self-expanding, but lists of entries is a whole other thing.
I believe it could be implemented for ContentParts pagination - when it's set with the nextpage/prevpage options. It's just so it has 'findable' next button - with special class or ID, so we can tell the IAS script what to look for.
As regards howto - it's just to figure out where it's the best to include necessary JS. In my opinion it would be the 'paginate version' of standard article template... I would not mess with other places for sake of general code 'purity'.
Re: Infinite posts feature / option
Posted: Sat 11. Jan 2014, 14:21
by update
It's now part of the
wiki
Thanks!