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

[Enhancement] Add the ability to filter items in Association Field #12

Open
bzerangue opened this issue Oct 8, 2014 · 11 comments
Open

Comments

@bzerangue
Copy link
Member

It would be great to add the ability to filter items in Association Field like the old Subsection Manager did...

That would be helpful if you don't want all the results showing up from the section that you are associating with.

@jonmifsud
Copy link

@nilshoerrmann & @brendo any ideas on this? I think it's a feature I'd be happy to implement with some guidance, probably even without. Looking to have a section with a 'type' field, due to content overlaps which doesn't make it feasible to have separate sections, but wouldn't want the client to associate/link the wrong type of content.

@jurajkapsz
Copy link

This would be great indeed.

@bzerangue
Copy link
Member Author

Any thoughts if filtering would be added?

@jonmifsud
Copy link

I will most certainly need to add this functionality for a client, though I didn't have time to dive into it yet. I'm hoping to have a look into it within the next couple of weeks.

@jurajkapsz
Copy link

Guys, what are your use cases for filtered options? Just wanted to check on mine (mentioned bellow), or get some more possible use cases.
And does it also means, that you would add tags as additional data to your entries for this filtering feature?

I was using SSM with filtering on a section holding lets say "content sources" like named groups of images, documents etc. Now I had to broke it into separate sections, but maybe its a bit better like this.

@jonmifsud
Copy link

My main use case is the following:

The client has a mixture of content types which are very similar - eg
'articles' and 'blog articles' they more or less have the same
relationships to categories/news sections. Functionality wise it would be
an overkill to duplicate all the fields and feature requests considering
all the fields are otherwise exactly the same.

My idea would be to apply filtering like what you would see in the backend
(have to confirm support) and ideally I want to use javascript data
attributes so I can switch parameters on the fly. This would give maximum
flexibility but might be out of scope for the association field itself.

On 3 January 2015 at 12:42, Juraj Kapsz [email protected] wrote:

Guys, what are your use cases for filtered options? Just wanted to check
on mine (mentioned bellow), or get some more possible use cases.
And does it also means, that you would add tags as additional data to your
entries for this filtering feature?

I was using SSM with filtering on a section holding lets say "content
sources" like named groups of images, documents etc. Now I had to broke it
to separate sections, but maybe its a bit better like this.


Reply to this email directly or view it on GitHub
#12 (comment)
.

@jurajkapsz
Copy link

Thanks for the example @jonmifsud . So you are having a single section for all the articles. The filtering idea is pretty advanced for me, but let's see what's possible first.

@jonmifsud
Copy link

Yes more or less. I have to work on an import/data migration next week.
I'll be switching to filtering once I get that all working, so I presume it
would be around a couple of weeks till I get to it. Obviously if someone
has some ideas for that I'm pretty open once I'll be working on it.

On 3 January 2015 at 16:52, Juraj Kapsz [email protected] wrote:

Thanks for the example @jonmifsud https://github.com/jonmifsud . So you
are having a single section for all the articles. The filtering idea is
pretty advanced for me, but let's see what's possible first.


Reply to this email directly or view it on GitHub
#12 (comment)
.

@nilshoerrmann
Copy link

If you'd like to implement this, I think the following steps are needed:

  1. A new setting needs to be added to the field (database and UI). In the UI, SSM used a tag list to suggest all tag list or select list values of the associated sections.
  2. The findOptions() function needs to take this new setting into account. If you follow the logic of SSM, you'd either have no filtering, matches (articles), exclusions (-comments) or a mixture of the latter (articles, -comments).
  3. If you'd like the Association UI Selector to take that new field setting into account, the query endpoint for the search needs to filter the output as well.

@jonmifsud
Copy link

@nilshoerrmann, Thanks for the pointers, I decided to start off with work on the Association UI Selector, I've modified the Query Endpoint and the publish.js script. So it can now accept url param filters (similar to the ones supported by the backend filters). And that seems to work great, I think the filters should be far more flexible the the old SSM.

If you think that does the trick I will be adding the Filtering UI to the association field itself. I was thinking it would be nice to go with just the Association UI Selector but setAssociationContext is part of the core, and not sure I should be messing with that.

Btw in which context is findOptions() used? is it only for the pre-filled textbox? As the Associations UI seems to do a fetch with Ajax straight away when the page is loaded.

@nilshoerrmann
Copy link

Btw in which context is findOptions() used?

Yes, it's used for the basic select box used if no interface is selected.

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

4 participants