This video walks through the view that creates the "My Edits" section of the "My Workbench" dashboard.
Editing the "My Edits" view
Go to "Structure => Views" (admin/structure/views) and select the view: My Edits (workbench_edited)
There are two displays for this view: a Page display, and a Block display. The block is what is used on the "My Workbench" dashboard, while the page is what you see when you click "View All" next to that block.
First, let's take a look at the Block display
The first things to note here are the relationships that are being used.
- The "Content revision: User" relationship allows us to get information about the user who has last edited a piece of content.
- The "Content revision: Content" relationship allows us to get information about a specific piece of content (ie: fields)
We are also using aggregation to ensure that each piece of content is listed only once.
The fields here look a little intimidating at first glance, but let's break them down by comparing them to the view output, and the relationships that we just discussed.
- The unique field here is the "COUNT(Content: Nid)" field. Because two pieces of content could have the same title, type etc. but each node has a unique Nid (node identifier) this allows us to ensure that each piece of content is only displayed once in the list.
- "Content: Title" is displaying the title of the revision.
- "Content: Type" displays the content type. (ie: Article or Basic Page)
- "Content: Published" specifies whether or not the revision is published
- "User: Name" displays the user name of the author of the revision
- "Content: Updated date" displays the last date the revision was updated
- "Content: Edit link" displays a link to edit the content directly
- "User: Current (Yes)" filters to content that the logged in user is the last editor of.
- "Updated date (desc)" lists most recently edited content first.
Now, let's take a look at the Page display. There is only one major difference from the Block display:
- All filters are all exposed. This is what allows us to filter content by title, Type and Published state on the page display