-
Notifications
You must be signed in to change notification settings - Fork 1
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
Filter content list by 'Service contact' #85
Comments
Hi @MariosORION did you get chance to look at this? Thanks Am looking for a few more issues for you if OK |
@willguv yes I've tried a few things but it's proving more tricky than I thought - I'll post my findings shortly.
Yes, please do |
To POC this, I've enabled localgov_workflows_notifications and created a service contact entity (associated to a Drupal user). Then, on the content View, I've added a new exposed filter "Service contacts" but only insufficient operators are available by default ("Is equal to" requires the user to enter the entity ID which is not very practical): ![]() The operator we need here is "is one of" similarly to the content type select list but this is not available by default for entity reference fields in content (such as service contact field on LGD nodes). I've tried Views Entity Reference Filter ![]() There are a couple of patches available for similar issues but neither of them seems to work. Better exposed filters doesn't provide the results required either. I'm thinking of writing a custom filter and adding it to the content View programmatically but that's considerably more work so it makes sense to ask for alternative suggestions, if any? |
following with interest |
@stephen-cox is suggesting looking at a hook_form_alter on the exposed field to generate a nicer user experience. @MariosORION if you can share the fatal error, perhaps we can fix the Views Entity Reference Filter issue ? @rupertj has used Views Entity Reference Filter with success. |
On the deployment question, we want to keep this as an optional feature for existing sites. One option could be a different view like /admin/content-by-owner |
PR #104 ready for review. Changes:
![]()
![]()
![]() To add the View when localgov_workflow_notifications is already enabled, Councils can manually import the View's YML configuration (views.view.localgov_content_by_owner.yml) into their site: Benefits of this approach:
Possible cons of this approach:
|
Thanks for doing this @MariosORION - could you add a screenshot to this page? Is there a composer command I can use to install this branch? |
@willguv it should be something like:
but I haven't tested it yet. I've added description and screenshots from the PR in my previous comment here. |
Thanks for your work on this issue @MariosORION . I've got an autocomplete filter working using your branch, a core patch and a contrib module: If this would be a good addition to this issue, do you want to try it or I can create a commit? I see you've already considered VERF, so I'm happy to keep this as a follow-up issue. See: |
Hey @Polynya, there's actually a PR for this issue already - please see #85 (comment). Benefits of this approach:
Possible cons of this approach:
Your suggestion (and thank you for that!) could also work -it's just a different approach, do you have a preference over the approach in the open PR? (There are some tests failing on the PR but I'll have another go today - any help is more than welcome!). |
Hi @MariosORION , I was using your PR but it doesn't allow you to see the content for just one owner. I think that the exposed filter is needed if there are a lot of pages and owners. |
@Polynya true, only sorting would be available with the additional custom View but no additional module is necessary. I'm more than happy to follow the alternative approach but I feel this should be a wider decision so best to discuss on a merge call (I'll try to make it today) :) |
Before finding this issue, I was working on a different approach, which is to display the pages relating to a Service Contact on their canonical page - |
I like this idea (feel free to push to this branch). I'm also thinking about permissions; would this allow all involved Drupal users (roles) to access the list of content for any given Service Contact? |
@Polynya could you provide screenshots of the work you've done? Trying to get my head round this - many thanks! (Sorry for not being present in this chat, was on holiday) |
Here's the Service Contact page, showing a block that I added to @MariosORION' s view (with a contextual filter to show content for one Service Contact) This is the "Content by owner" page using the view with the exposed filter added: Although I used a contrib module for the entity reference filter, I don't think it's essential. It does need a core patch though, and it may be best to wait until it's merged: |
@Polynya Nice to see core is finally getting the ability to add entity reference filters to views. I've ended up doing hook_form_alters to get this sort of thing working in the past. The issue seems to be quite active, so probably best to waiting to see if it gets committed soon. In the meantime I suggest we get Marios' work on this committed and the service contact filter added later. |
PR #104 tests are now clean and suggestions committed @stephen-cox @Polynya @willguv . Thanks all! |
Following on from #12
Content designers would like a view showing the pages assigned to a specific service owner
Could we add a 'service contact' drop down to filter the main content view at /admin/content?
The order would be
Title / Content type / Published status / Service owner / Language
This is based on amount of use each gets - my hunch is editors would use it less than published status but more than language
The text was updated successfully, but these errors were encountered: