How to display entire user list on members page w/NO pagination?
I don't see any reference to pagination in either the controller or single page for the members.php page.
Anyone point me in the right direction?
protected $itemsPerPage = 10;
You'll want to override this file, not just edit it completely.
Thanks for the direction. Very helpful.
Here's how I accomplished what Lucas suggested (for those of you unclear on how to avoid modifying the core):
1) I searched for '/concrete/models/user_list.php' and copied the file to '/models/user_list.php'
2) Opened the copied file in a text editor and changed line 24:
protected $itemsPerPage = 10;
protected $itemsPerPage = 100;
This sets the new default to 100 records displayed, fine for my current project.
Curiously, when I remark that line out of the file, I get 20 users per page. Is there another place this is set?
Thanks for the tip, Lucas. I've marked your answer.
Where do you go to learn this stuff (other than experience)??!!
#2 going through the code
#3 search the code :)
Mainly I've learned it from experience. It has been necessary to touch almost every piece of the code in my years with this system. Also, it helps that each file usually points you in the right direction. You'll notice your controller for your members single page has a call to load a model called 'user_list'. I just looked in the models folder for the user_list.php file.
Also, I would suggest browsing the config files. There's some good stuff in there.
Thanks again for the help.
I've been using C5 for less than a year. Clearly the best CMS product out there, especially from the end-user perspective.
I might add, sites are so easy to build & configure (especially with the add-on marketplace) that my business has increased exponentially. Everything is so much more stable than drupal or joomla plugins because of the structure in place.
As Shotster reminded me, I don't necessarily know everything or even the best way to do things, but I've been around for a long time and have great respect for the core team and concrete5.
The feeling about concrete5 is mutual. :)
$myUserList->setItemsPerPage( 100 );
> of breaking with an upgrade,
Ok, it has VERY LITTLE chance of breaking with upgrades.
> or is a much better approach, but you are correct,
> it is another approach.
No, it is in fact WAY better (and simpler) than duplicating and overriding a core file and altering a protected property. I mean, it's precisely what that public method is for. Consider, for instance, what happens when the OP has another user list which he DOES want paginated. At some point, he'll have to invoke the method! Why not write a simple line of code from the outset instead of altering core files and altering private members? It's just not necessary.
If you use the override folders, there's no chance upgrades to the core will overwrite your mods. Granted, you may have to adjust your override code, but I think it's pretty safe.
> upgrades to the core will overwrite your mods.
Understood. What I'm saying is that the internal workings of the class itself could change in a new version of C5, and that could very well break parts of your site that rely on your customized implementation. You have to REMEMBER to check (and alter if necessary) your core overrides with each and every upgrade. Why do that when the problem is solved with one line of code?
> Granted, you may have to adjust your override code
Or more specifically, you have to REMEMBER to adjust your code. I've been bitten in the @ss more than once by that.
> in the root "models" dir?
Yes, if you read the thread, you'll see that was suggested; but it has disadvantages.
You might find this recently released add-on helpful...
Among other things, pagination can be explicitly disabled (although it's disabled automatically if the number of users is less than the specified page size).