Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-26 17:03:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Handle multiple images and files

Apologies for raising this again, but I’ve just been asked how to delete more than one image from the Images tab and I didn’t have an answer. It’s been asked before hand and done to death with some fab suggestions that even delved into xPattern territory.

All that is great but what about a stop-gap solution until a direction can be decided? Traditionally I’ve used SQL but I can see how that can be a tad laborious on a site with many hundred semi-unsorted images. Not to mention a bit unfriendly to non-SQL-geeks. Deleting a whole category or two is a relatively simple bit of code, but a whole bunch from multiple categories is trickier/error prone/time consuming (delete as applicable).

So, I haven’t thought this through extensively but is it feasible to add something like a Delete or Delete these button (with the usual “confirm” logic) that would delete all images currently showing as a result of the search?

e.g:

Without any search criteria it would delete all images. With search criteria it would only remove the ones showing as a result of the last search. In other words, you can “test” to see which ones will be deleted by filtering them first using the “Go” button and, once you’re happy, hit Delete to say goodbye to them. Either way, it blats whatever images are currently in the on-screen list. One or two iterations of this and you could save tonnes of manual scroll-click-wait cycles. The traditional “check each object, select action and confirm” approach is unwieldy with large numbers of images/files (in fact it’s sometimes unwieldy with articles and categories but less so).

Questions:

  1. Is something along these lines logical? (my brain says yes, others may disagree)
  2. Assuming yes to (1), is it possible to make use of the TXP core functions to conceptually do multi_delete(results_of_last_search); or multi_delete(run_current_search_criteria_again);

Are multiple image operations part of the plan in 4.0.x? Crockery? If not — and this sort of idea has legs — I’d have a go at doing it, probably as a plugin at first to test the water, unless anybody’s done it before or is going to warn me off (or can make a better job of it than me!)

Of course, the fun doesn’t have to (and shouldn’t) end there. I’m just scoping it out with a concrete example; delete. The logical thing to do would be to have a “with these images/files, do” drop-down exactly like the other screens so images can be deleted, moved to other categories, blah blah. The only difference being it performs the action on the search results, not with checked images. No doubt this sort of thing has been suggested before.

Thing is, I don’t want to have to write a whole search facility just to pass the results to another function if some of the code is already in the core. I’m struggling to see how the search results get passed back to the page. Layers and layers of functions to trace… Are the results of the current search passed back as an array? Which function does that? Is it available for hijacking by a multi_xx() function to iterate over it and do the dirty work or is it output directly to the page, tags and all? Is the existing multiple-operation function for other screens able to be used here, or will it have to be custom written? Too many questions; not enough time, cried Alice!

Techies and designers alike, what’s the feeling on this? Useful from an admin-user perspective? Where would the feature “sit” on the page? Would it integrate well with custom back-end solutions/templates? Is it technically feasible or too much work in the current branch? I’m just trying to get a feel for the technical possibilities/user experience, but in the cheapest possible way (in terms of development time). And I don’t particularly want to hack the core; a bit of jQuery to add the interface element(s) to the admin side is as far as I’d like to go.

From my perspective I’m not looking for the ultimate bells and whistles solution as discussed on the Improving TXP Image Management thread. But something — any quickish fix — to be able to handle large numbers of images and files a little better until the next big leap to Crockery would be a massive improvement for me as a site builder/maintainer/hacker.

Then again I guess if it was easy, or possible, it’d have been done by now, right?

Last edited by Bloke (2007-11-26 17:11:35)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2008-06-28 08:55:38

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Handle multiple images and files

TXP 4.0.7, image multiselect:

Offline

#3 2008-06-28 08:59:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Handle multiple images and files

Yay!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2008-07-07 03:01:17

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Handle multiple images and files

[ Insert digital drool here. ]

)

Offline

Board footer

Powered by FluxBB