Quickly find pages in Edit mode?
Permalink
Is it possible to quickly find which pages are in Edit mode? When I go to the dashboard it says I have n pages in edit mode, but I can't find a way to quickly see why they haven't been published.
![adajad](/files/avatars/37694.jpg)
Anyone?
Check out following files:
This one displays the activity module:
yoursite/concrete/elements/dashboard/modules/activity.php
The logic can be found here:
yoursite/concrete/controllers/dashboard/modules/activity.php
If you just want the number of pages in edit mode, you'll need the following code:
You can also check out how the PageStatistics model actually gets the number if you look at the model in:
yoursite/concrete/models/page_statistics.php at line 87
You could also try to use the Page List object to get actual Page objects:
...or just get the Page ID's somewhat the same way the as the function in PageStatistics model and then get the Page objects with Page::getByID($id);
This one displays the activity module:
yoursite/concrete/elements/dashboard/modules/activity.php
The logic can be found here:
yoursite/concrete/controllers/dashboard/modules/activity.php
If you just want the number of pages in edit mode, you'll need the following code:
Loader::model('page_statistics'); echo PageStatistics::getTotalPagesCheckedOut();
You can also check out how the PageStatistics model actually gets the number if you look at the model in:
yoursite/concrete/models/page_statistics.php at line 87
You could also try to use the Page List object to get actual Page objects:
Loader::model('page_list'); $pl = new PageList(); $pl->filter('p1.cIsCheckedOut', '1', '='); $pages = $pl->get(); $foreach($pages as $page) { echo $page->getCollectionName(); }
...or just get the Page ID's somewhat the same way the as the function in PageStatistics model and then get the Page objects with Page::getByID($id);
Thanks, I'll have a look.
For anyone else trying to discover what pages are in edit mode,
The code above is almost correct. just remove the $ from in front of foreach and it will work,
Like this,
The code above is almost correct. just remove the $ from in front of foreach and it will work,
Like this,
<?php Loader::model('page_list'); $pl = new PageList(); $pl->filter('p1.cIsCheckedOut', '1', '='); $pages = $pl->get(); foreach($pages as $page) { echo $page->getCollectionName(); } ?>