Exercise 6.1: Build the employment news view

In this exercise we’ll build an Employment news page/listing by creating a new view. This view page will list all job posts.

Create the view using the wizard

  1. Go to StructureViews to see the Views admin page - /admin/structure/views.

  2. Click the Add view button at the top of the page to access the view creation wizard. To create the Employment news view, enter the below details:

    • View name: Employment news.

    • Description: “Displays a list of news about Employment on the site.” This allows Site administrators to easily see what the view does.

    • Show: Content.

    • of type: Job Post.

    • sorted by: Newest first.

    These dropdown selections set up the page with the Job Post content displaying, showing the most recent job first.

  3. Next, check the Create a page checkbox to create the new views page. Leave the Page title and Path fields as-is - they should already contain Employment news as the name of our view.

  4. In the page display settings area, select:

    • Unformatted list and teasers.

    • Items per page: 10.

    • Use a pager.

    • Create a menu link to expand options.

    • Menu: Main navigation.

    • Leave default Link text as Employment news.

    • Click Save and edit.

    • Review your changes.

Review your changes

After saving the view, navigate to the frontend of the site. Check if the Employment news appears in the main navigation at the top. If the menu does not initially appear in the primary navigation section, it can be due to caching. You can either ask your developer to clear the cache or wait 24hrs for the cache to be automatically cleared.

Click on the new menu to explore any Employment news that you may have published on your site.

If you only see one Job Post, create additional Job Posts to see how Views takes care of listing them automatically.

Last updated