November 3, 2023
Background: I work on a site with different groups of users, to manage which we use not only core Drupal roles and permissions, but the Group module. Recently the site owner requested to add a Workflow to a content type. Clients need to be able to see the workflow state and change it, but not be able to see or edit the original node, or even the workflow tab on the node.
We manage client access…
Allow users to update an entity's Workflow status from a Drupal view
December 20, 2022
Recently I discovered an odd Drupal Views bug. While testing a view I realized that content it should have shown was missing from one display. After a lot of testing, it turned out it was due to two relationships to content in entity reference fields on the content type my view displays. These fields were empty in the missing nodes. Removing the relationships or adding content to those fields…
Drupal views doesn't show content if entity reference field relationship is empty
January 21, 2021
Previously, I posted about how to create a view on a user's profile of content authored by that user, limited to content in Group(s) the viewing user is a member of. That tutorial shows how to accomplish that with a view of content (Drupal nodes) which are in Groups.
The person who requested that tutorial later told me they needed a view of Group content. Group content is the relationship between…
Show group content on author's user profile, limited by viewing user's Group membership - Drupal 8 & 9
October 24, 2020
See also how to do this with a view of Group content
Someone contacted me asking for help with the following:
I am trying to look at the particular user profile, and below that profile contains a stream of content nodes which I will be able to see only content created by that particular user in group that I am a member of.
Example. If A is a user who created 2 Group’s and has added me to one of…
Show content on author's user profile, limited by viewing user's Group membership - Drupal 8 & 9
June 1, 2020
I previously wrote about how to create a View of content from a Group that a user is a member of. For another site, I have to show a list of other members in the same group on user profiles. Another common use case might be showing a logged-in user a list of other members in his/her group(s).
You can do this two ways:
Create a View of Group Content of type [Group name]: Group membership
Create a View of other members of a Group - Drupal 8
May 19, 2020
Drupal has gotten so much more powerful and easy to work with, but there are still a few things that are missing that seem like they should be a given. Such as, the ability to format certain Views exposed filters, like node titles or Group names, as dropdown select lists rather than an empty textfield that requires the user to know what the possible options might be instead of presenting them.…
Group names as Views exposed filter select list - Drupal 8
January 14, 2020
The Group module is a powerful one I turn to often when a site has a requirement for groups of users who should have specific permissions, access to edit or view specific content, etc.
A common requirement is to show a list of content belonging to the Group(s) a user is member of, using Views. That isn't as straightforward as it seems. I recently had to do this and struggled a bit, so thought…
Create a View of content from Groups a user is member of - Drupal 8
October 3, 2019
I'm working on a website which has a list of products, displayed in a View. Each product has an "provider" who produces it, associated with the product content type by an entity reference field to a Provider content type and displayed in the view. The client wanted contact information for the providers to show up in the list as well.
It would have been a bit bulky and repetitive to have the…
Show complementary information in a View based on exposed filter choice - Drupal 8
June 7, 2019
A common pattern for websites is a list of content, for example news, with one (or more) featured items, followed by a list of a few more items, excluding the featured one(s). This seems like it should be simple to do, but it's not as straightforward as it seems.
Here's an example of how to achieve it with Views in Drupal 8. There are many ways of flagging featured content. In this case, we want…
How to create a View with a featured item and a list that excludes the featured item, Drupal 8