Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add quick filter to collections / browse #958

Open
DBinaghi opened this issue Sep 1, 2021 · 3 comments
Open

[Feature request] Add quick filter to collections / browse #958

DBinaghi opened this issue Sep 1, 2021 · 3 comments

Comments

@DBinaghi
Copy link
Contributor

DBinaghi commented Sep 1, 2021

Hello.

It would be useful to have a quick filter function also for the collections / browse page. I guess #900 could address the issue.

Hope this helps.

@DBinaghi DBinaghi changed the title Add quick filter to collections / browse [Feature request] Add quick filter to collections / browse Oct 11, 2022
@DBinaghi
Copy link
Contributor Author

DBinaghi commented Mar 7, 2023

In the meantime, I've developed a plugin that is adding this feature, and other ones, to Collections: https://omeka.org/classic/plugins/CollectionsPlus/

I still think it might be a good idea to add those features to the core, as more and more users seem to have large amount of Collections in their repositories.

@zerocrates
Copy link
Member

Can you remind me: we talked about your plugin a little before, and I recall that you needed to add a query/SQL filter to do some of what you wanted to for "quick filtering." What was that filter you had to add?

@DBinaghi
Copy link
Contributor Author

DBinaghi commented Mar 8, 2023

I wanted to add an option that allows to filter only empty Collections.

I've been using this code to implement it:

if (is_admin_theme()) {
	$select = $args['select'];
	$params = $args['params'];
	if (isset($params['empty']) && $params['empty'] == 1) {
		$sql = "`collections`.id IN 
			(SELECT c.id 
			FROM `{$this->_db->Collection}` c LEFT OUTER JOIN `{$this->_db->Item}` i ON c.id = i.collection_id
			WHERE i.id IS NULL)";
		$select->where($sql);
	}
}

Of course, as you pointed out, a change in the core would be easier and shorter, with an extra case for the existing switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants