How to change the # comments shown?

Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
How does one limit the amount of comments showing on the page?




--

Ken Rich
indiegospel.net

updated by @ken-rich: 02/01/15 03:47:57AM
michael
@michael
11 years ago
7,768 posts
The comments are controlled by the comment_form.tpl template
/modules/jrComments/templates/comment_form.tpl

They are set by default to show 500.

You can change that in the templates by going to
ACP -> USERS -> USER COMMENTS -> TEMPLATES -> comment_form.tpl

Then MODIFY and search for this line:
{jrCore_list module="jrComment" search1="comment_module = `$jrComment.module`" search2="comment_item_id = `$jrComment.item_id`" order_by="_created `$_conf.jrComment_direction`" limit="500" profile_owner_id=$profile_owner_id}

The limit="500" is what your after. Change that to whatever you want.

eg: changing it to this:
{jrCore_list module="jrComment" search1="comment_module = `$jrComment.module`" search2="comment_item_id = `$jrComment.item_id`" order_by="_created `$_conf.jrComment_direction`" page=$_post.p pagebreak="2" pager="true" profile_owner_id=$profile_owner_id}
would give you 2 comments per page and a pager visible to move to the next page.

The full details for jrCore_list can be found here:

"{jrCore_list}"
http://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list
Ken Rich
Ken Rich
@ken-rich
11 years ago
926 posts
OK - thanks Michael. I'll try that...


--

Ken Rich
indiegospel.net
Strumelia
Strumelia
@strumelia
11 years ago
3,603 posts
That worked for me- thank you!
I had a member with several hundred comments and his page went on foreverrrrrr (trying to imagine that on a smartphone...shudder). Now after my set number of comments it shows an arrow for 'next page'. :)

P.S. I'm learning?- I did the change from my server side template. Because yes.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
11 years ago
3,603 posts
Hmm...but this has me thinking- why is the default set at 500 comments showing anyway? Are there really bunches of people who would want a profile page to be 500 comments long in this day and age, on mobile friendly platforms? That default 500 setting almost guarantees that everyone will want or need to figure out how to go in and change it. It was definitely on my own list of "things to ask how to do". Shouldn't the default for things like this be something that is relatively easy to live with right off the bat, like say showing the first 30 comments before pagination? Just thinking out loud.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
11 years ago
10,148 posts
I personally like all comments on the same page, so I think it's going to be up to the site owner to decide how they want it. We can definitely look at improvements to make it easier to do (i.e. skin config) which we're doing.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
michael
@michael
11 years ago
7,768 posts
Strumelia:..P.S. I'm learning?- I did the change from my server side template. Because yes....

Seams like it! :)

I'm a fan of ctrl+f. I use that to find what I'm after in the browser. ctrl+f "chocolate". When there are tons of pages, you its less useful.

Fan of all comments on the same page.