# Exercise 6.10: Administration with View bulk operations

In this exercise, we'll create a way for content approvers to view all content waiting for approval, so they can quickly and easily review and publish new content.

## Prepare the site

In the current setup, content editors can create and publish job postings. We’re going to change this, so that new job postings must be reviewed by a Content Approver before being published. To do this, we’ll introduce a moderation workflow.

1. Go to *Configuration* → *Workflow* → **Workflows**.

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-0b2aae8a8b5442b472987023ae41089cf519c9b3%2FEx-6-10-Workflows-1.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Edit the existing “Editorial” workflow. We’re going to reuse the existing workflow states and transitions as-is, to match the moderation workflow of the rest of the site.
3. Scroll down to **This workflow applies to** section and press **Select** in the **Content types** row.

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2FiueEeNIv8lDkzkoCvzH9%2Fimage.png?alt=media&#x26;token=09543b84-8dcd-4259-ac71-7a2c8ad6b8e9" alt=""><figcaption><p>Select button next to Content types in Workflow</p></figcaption></figure>
4. Select the **Job Posting** checkbox, **Save** the changes.

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2F786uPt8mm5kYrvBFWZFi%2Fimage.png?alt=media&#x26;token=30631996-b75b-49dc-8122-7f564996a63c" alt=""><figcaption><p>Select Job Post</p></figcaption></figure>
5. Press the **Save** button in the Edit Editorial workflow page.

## Add the view

1. Create a new View with the following settings:

   | View name          | Admin: Submitted job postings |
   | ------------------ | ----------------------------- |
   | Show               | Content of type: Job Posting  |
   | Page title         | Submitted jobs                |
   | Page path          | admin/submitted-jobs          |
   | Display format     | Table                         |
   | Items to display   | 50                            |
   | Use a pager        | Selected                      |
   | Create a menu link | No                            |
   | Create a block     | No                            |

   > **Hint**: Go to *Structure* → *Views* → **Add View**.

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-66ce395a5ae511c59199f002ccddb63907992631%2FEx-6-10-Workflows-4.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Click **Save and edit**.

## Add fields

{% hint style="success" %}
**Tip:** Select multiple fields at a time and configure them sequentially.
{% endhint %}

1. Add these fields:
   * Content: **Node operations bulk form**
   * Content: **Authored on**
   * Content: **State**
2. Configure the **Bulk operations**: Available actions:

   * Delete content
   * Save content
   * Update URL alias

   &#x20;

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-2f46c25701270ae3ff7c5e841f69503aecd8eaef%2FEx-6-10-Workflows-5.png?alt=media" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-6ef1d05e344d2f6d2d45277c0739f3f8b3a8f0fe%2FEx-6-10-Workflows-6.png?alt=media" alt=""><figcaption></figcaption></figure>

Note that we did not select the “Publish content” and “Unpublish content”. Since we have a moderation workflow in place, these actions won’t work on our site.

![Image of View](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-061293a3d366504f566d361543dd7b5be3c86920%2FEx-6-10-Workflows-7.png?alt=media)

Keep other defaults for the remaining fields. Remember to **Save** your changes to the View.

## Rearrange fields

Click the dropdown next to the **Add** button in the *Fields pane* and select **Rearrange**.

![Image of Rearrange fields](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-9eb6c09ba2421893d119cc9a6a76db947778d7ef%2FEx-6-10-Workflows-8.png?alt=media)

![Image of Rearrange fields](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-d025f4a044ec287b128639ce43dce4f9908ac30a%2FEx-6-10-Workflows-9.png?alt=media)

## Remove unnecessary filters

The filter **Content: Published (= Yes)** can be removed as we will be replacing it in the next section.

![Image of Remove unnecessary filters](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-23752cb3347ffd6ca541b0654923a110e8b26245%2FEx-6-10-Workflows-10.png?alt=media)

![Image of Remove unnecessary filters](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-e3d5be917b992cde9d8059b15b11ef0c62323671%2FEx-6-10-Workflows-11.png?alt=media)

## Add moderation workflow filter

To only see Job Postings that are pending approval, add the **Content: Moderation state** filter. Configure the following options:

![Image of Add moderation workflow filter](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-db12b73f035954c62ba67208ab96ee4778b8626e%2FEx-6-10-Workflows-13.png?alt=media)

> **Tip:** Hold down the Command key (Control for Windows) to select multiple options.

## Configure the format settings

![Image of Configure the format settings](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-adef083c35e40ebf752edb376bbd43bd2e3ea4c4%2FEx-6-10-Workflows-14.png?alt=media)

Edit the table settings. Ensure any column that can be sortable is selected. Set the default order for *Authored on* to Descending.

![Image of Edit sortable settings](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-3d30f1f9c3fd41d3b16a55634dd2f417e89bfc0a%2FEx-6-10-Workflows-15.png?alt=media)

## Add a "no results" message

Adding a “no results” message will clearly show that the view IS working properly if/when there isn’t any content waiting for approval.

1. In the middle column, under **NO RESULTS BEHAVIOR**, click **Add**.
2. Select Global: Text area

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-56b404f000d5c8c57e265faf8549fd4bb62acf37%2FEx-6-10-Workflows-16.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Then set the message “There are no job postings currently waiting for review!”.

   <figure><img src="https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-ed5e3bb3838dbecdb3b65d789c140e13e719185f%2FEx-6-10-Workflows-17.png?alt=media" alt=""><figcaption></figcaption></figure>
4. **Apply** the changes.

## Change access settings for this view

Lastly, we will change the access/permission settings for this new view, from **View published content** to **Administer content**. Note that you can only do this with a user belonging to a role that has the necessary permissions.

![Image of View - Access](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-c445d4fc55837362a67f98882a215657622f778c%2FEx-6-10-Workflows-18.png?alt=media)

![Image of Change access settings](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-7f8b38e8d33d49b29cb063f545ec78fb31ac8a96%2FEx-6-10-Workflows-19.png?alt=media)

## Save and review

Save the view and review. Go to admin/submitted-jobs. If there are no Job Listings in Draft status you should see the screen below:

![Image of No jobs waiting for review](https://3186608908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LzAsrTcKaHnLDg-7ALW%2Fuploads%2Fgit-blob-bbe4add84632c5782d997beb952cea8f87738e0d%2FEx-6-10-Workflows-20.png?alt=media)
