Jump to content

Admin Page - "Recently Edited Articles" Link


Recommended Posts

Hi Ryan and All,

Not sure if it's too late for v2.4, which I'm really excited about, but I'm wondering if the new admin pages could include a link at the top, next to search, to display the most recently added or edited pages. It's very convenient when one has to log back in and make a change to a recent article. It's quicker than search.

MODX Evo has it, and it would be nice for PW to have it too.

Just a thought. :-)

Peter

Link to comment
Share on other sites

Hmmm, 

You could easily do this with a very simple module, no? E.g. make use of Soma's latest jQuery Data Tables helper class (with Ajax goodness, etc) or PW inbuilt MarkupAdminDataTable. I'll post a link to a short demo video here and some code in Github to show you how simple this can be accomplished.....

Edit: added video demo

code: Will upload soon....it is very rough code, a proof-of-concept... ;-) As you can see from the video, a couple of things could be improved!

Uploaded here

The code here is so trivial it shouldn't even be upped to Github. However, I hope this helps to show newbies that PW is dead-easy!..even for PHP newbies like me!

Pete, sorry to hijack your thread :-)

Edited by kongondo
  • Like 6
Link to comment
Share on other sites

Always such great videos kongondo, and a great module too.

Just also thought it worth mentioning that several of the 3rd party themes out there all display last created / last edited in either a sidebar, or at the bottom of the page, eg: Moderna and MetroWire. 

It's often as simply done as something like this:

foreach($pages->find('limit=5, sort=-modified') as $p){
    if ($p->editable()) {
        echo "<li><a href='".$config->urls->admin."page/edit/?id={$p->id}'>". date('d.m.', $p->modified) ." " . $p->title . "</a></li>\n";
    }
}
  • Like 2
Link to comment
Share on other sites

Dear Kongondo and Adrian,

Yes, those options are good ones.

I just thought it would be cool if it was included by default in the new PW version.

I installed a few of those other admin templates, but ended up coming back to the PW flavor.

One day, I'll work on modifying an admin theme myself: just haven't gotten there yet.

Peter

  • Like 1
Link to comment
Share on other sites

Thanks kongondo!! This module is just what I needed. I will check it out! I've been working on my own version of an admin table, so this is a lifesaver

I definitely think that PW should have these tables by default with search and filtering. It would be cool to have them generated via the admin ui, with options as which templates to list or from which parent or a custom search (just like the Page field options). It would complement the site tree in a nice way. Blogs and other kinds of data are better displayed as a table. This module looks neat!

  • Like 1
Link to comment
Share on other sites

I'm glad you like it landitus.

In a sense, PW already has those tables by default - they are just not set up yet :-). As you know, PW gives you the tools to build what you want (in this case MarkupAdminDataTable). If you look at the code in my example module, it is all PW API. Yes, it has some in built classes to interact with javascript, but it is all PW. Part of PW philosophy is to be clean, lean and mean and not make presumptions. 

I am liking your idea about generating such tables via the admin UI. Actually, similar things have been done. See the proof-of-concept module by Soma DataTable. Batcher also comes close. Ryan has also spoken of developing a site where pages appeared in a table (IIRC) when they reached a certain number in the tree or toggable or something. I can't really remember the details. But yes, it can be done. 

Back to the admin tables, if it is something you'd like to discuss, let's open a new thread. In a sense though, Batcher already fulfils some of the functions you are talking about, albeit it is not configurable in terms of what to display.

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

thanks kongondo. Soon I'll be tackling this issue for a client and I'll be sure to check your code first. Also, this would be a great opportunity to start a new thread and discuss it further. I'm interested in using the native tools PW to enhance the admin as well! 

Link to comment
Share on other sites

Just want to add that I think that this sort of thing should take the form of a module for sure.

It's much better to start lean and add things later. This should be seen as a preference and it would be an annoyance to those (me, included) who wouldn't have a need for it.

I think it's a perfect example for what a module should do. For example check out Teppo's excellent "Changelog" module.

Link to comment
Share on other sites

Kongondo, great video and module! I hope you'll add this one to the modules directory when ready. 

Also for those above, wanted to mention that Teppo's Changelog module is also a good way to look at what's been edited recently.

In terms of having a list of "recent edits" display in the default admin theme, that kind of goes against the desire to keep the admin theme as minimal as possible. I don't disagree on the usefulness of it, just think it doesn't belong in the default admin theme. I'd rather leave that to other admin themes, or support such features in the future with theme-specific 3rd party installable modules or widgets (this could be fun). 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...