LogoLogo
  • GovCMS8 Site Building Training Manual
  • Contributing and Feedback Guide
  • Software and module requirements
  • UNIT 1: FUNCTIONAL ANALYSIS
    • Overview
    • Layout of a GovCMS page
    • Regions in GovCMS
    • Planning your site
    • About our client
    • Understanding requirements
    • Audience analysis
    • User (visitor) personas
    • Define user stories
    • Roles and Permissions
      • Exercise 1.1: Configure account settings
    • Blocks in GovCMS
      • Exercise 1.3: Place Welcome message block
    • Site navigation
    • Footers
      • Exercise 1.4: Build the related links menu
      • Exercise 1.5: Assign the related links menu block to a region
      • Exercise 1.6: Configure the related links menu block
      • Exercise 1.7: Rearrange the main menu
    • Theme settings
      • Exercise 1.8: Change the logo
      • Exercise 1.9: Create a friendly error page
    • Unit 1 Summary
  • UNIT 2: DESIGNING AND PLANNING CONTENT
    • Designing and planning content
      • Exercise 2.1: Compare content types
    • Planning your site structure
    • Planning data entry and display
    • Discussion
      • Exercise 2.2: Design a content type in minutes
      • Exercise 2.3: Create a content type
    • Add and configure fields
      • Exercise 2.5: Modify an existing field
      • Exercise 2.6: Add a custom text field
      • Exercise 2.7: Review the field list report
    • Manage form display
      • Exercise 2.8: Testing content types
    • Unit 2 Summary
  • UNIT 3: MANAGE MEDIA
    • Manage Media
    • Customise image display with image styles
    • Review configuration of image media display
      • Exercise 3.1: Example use of image styles
      • Exercise 3.2: Add and configure a media field
      • Exercise 3.3 (Challenge): Change image size
    • Unit 3 Summary
  • UNIT 4: TAXONOMY - CATEGORISING CONTENT
    • Taxonomy - Categorising content
      • Exercise 4.1: Add new Vocabulary
      • Exercise 4.2: Add Taxonomy field to content types
    • About input options
      • Exercise 4.3: Add fields to content types
      • Exercise 4.4: Test the new vocuabulary
    • Editorial considerations
    • Prepare documentation for new staff onboarding
    • Content creation forms
    • Unit 4 Summary
  • UNIT 5: TEXT FORMATS AND RICH TEXT
    • Text formats and rich text
      • Exercise 5.1 (Optional): Set up the Rich Text editor
      • Exercise 5.2 (Challenge): Create a new text format
    • About cross-site scripting
    • Text formats
    • Unit 5 Summary
  • UNIT 6: CONTENT LISTING WITH VIEWS
    • Content listing with Views
      • Exercise 6.1: Build the employment news view
    • Views - Part 2
      • Exercise 6.3: A customised News and Media page
      • Exercise 6.4: Reuse a Views template
    • Related content by term
      • Exercise 6.5: Make a list of States/Territories block
      • Exercise 6.6: Build the related content block
      • Exercise 6.7: Configure data field and Event content type
      • Exercise 6.8 (Challenge): Extend Content type
      • Exercise 6.9: Modify an event listing for future dates
    • Customize the content administration experience
      • Exercise 6.10: Administration with View bulk operations
    • Unit 6 Summary
  • UNIT 7: URL ALIASES
    • URL Aliases
      • Exercise 7.1: URL aliases - Patterns
    • URL Redirects
      • Exercise 7.2: Configure redirects
      • Exercise 7.3: Breadcrumbs
    • Menu check
    • Unit 7 Summary
  • UNIT 8: SITE BUILDING EXERCISES
    • Site building exercices workshop
    • Extend content types with new fields
      • Exercise 8.1: Add an external link field
    • Agency reference link
      • Exercise 8.2: Create Agency References
    • Job list dropdown filter
      • Exercise 8.3: Configure the job listing
      • Exercise 8.4: Agency logo in Job Posting view
      • Exercise 8.5: Challenge exercises
    • Discussion
    • Views contextual filters
      • Exercise 8.6: Add About author block to News article
    • Further discussion and exercices
    • Employee list and custom profiles
      • Exercise 8.7: Set up profile fields
      • Exercise 8.8: Create a list of users
      • Exercise 8.9: Edit the existing view to filter out roles
      • Exercise 8.10: Create a custom layout
      • Exercise 8.11 (Challenge): An image gallery
    • Unit Summary
    • Discussion
  • UNIT 9: SEARCH AND RELATED CONTENT
    • Search and related content
      • Exercise 9.1: Explore the default search
      • Exercise 9.2: Set up Job posting content type display in global search
      • Exercise 9.3: Create new search page with Search API
      • Exercise 9.4: Add fields to the index
      • Exercise 9.5: Extend the search with Facets
    • Unit Summary
  • UNIT 10: SITE PERFORMANCE
    • Overview
    • Planning for Peformance
    • Define Goals and Requirements
    • Review current issues and bottlenecks
    • Other performance considerations
    • Unit 10 Summary
    • Glossary of terms
    • Appendices
Powered by GitBook
On this page
  • 1. Locate the View
  • 2. Change the number of items to display
  • 3. Add a new display: an attached list
  • 4.Add a header to the attachment
  • 5. Change the offset to exclude the first three Jobs
  • 6. Change the attachment settings
  • 7. Review your changes

Was this helpful?

Edit on GitHub
Export as PDF
  1. UNIT 6: CONTENT LISTING WITH VIEWS
  2. Views - Part 2

Exercise 6.3: A customised News and Media page

PreviousViews - Part 2NextExercise 6.4: Reuse a Views template

Last updated 1 year ago

Was this helpful?

In this exercise we’ll customise the Employment news View page we created earlier, making it show three items of recent content, then a bulleted list of titles of seven more jobs. Below is what the layout of the page will look like.

There are seven stages in this process:

  1. Locate the View

  2. Change the number of items to display

  3. Add a new display: an attached list

  4. Add a header to the attachment

  5. Change the offset to exclude the first three articles

  6. Change the attachment setting

  7. Review your changes

1. Locate the View

  1. Navigate to the admin/structure/views and edit the Employment news view.

2. Change the number of items to display

  1. Under Pager click "mini" to change the settings.

  2. Select "Display a specified number of items".

  3. Click Apply.

  4. Change Items per page: 3.

  5. Click Apply.

Now check your preview to confirm three items are displayed. Scroll down to the Preview section to check only three items are displayed.

3. Add a new display: an attached list

Next we'll add a list of seven more recent jobs to the bottom of this view.

  1. At the top, click the +Add button and select "Attachment".

  2. You’ll now have more than one display available, with the one you’re editing highlighted. Make sure the correct one is always highlighted when you’re editing views.

  3. Next click Unformatted list under Format in the left column. A new window will pop up, giving you the option to select the display you're changing.

  4. Select "This attachment".

  5. Select "HTML list".

  6. Click the Apply (this display) button.

  7. The next screen is “Attachment: Style options”. Leave all settings as default and click the Apply button.

  8. Under Format → Show, click Content to change the settings. Select the Fields radio button.

  9. Then click Apply on the final screen, leaving the settings as they are.

  10. You'll see that Views added a Title field for us. If we needed more fields to be displayed, we could have added them using the Add button. Let’s continue with only the Title field for now.

  11. Check the Preview pane at the bottom of the page to confirm our display is correct.

4.Add a header to the attachment

  1. Under the Header section on the View page click Add.

  2. Make sure you’re editing "This attachment (override)".

  3. Search for and select "Text area". Apply changes.

  4. Make sure the Text format for the Content field is Rich Text. Then type in the Content field: <p>More Jobs</p>

  5. Apply the changes.

  6. Check that the preview shows text ‘More Jobs’ above the list.

5. Change the offset to exclude the first three Jobs

Our Attachment view will be displayed below the first three Jobs, so we need to exclude those from our list to avoid displaying duplicate content:

  1. Make sure you're still editing the Attachment display. Under the Pager settings in the centre column, click "10 items" to change the setting.

  2. Change the “Items to display” to 7 and the "Offset" to 3. Apply the changes.

6. Change the attachment settings

  1. Under "Attachment settings" in the centre column click the option: "Attach to:" Not defined.

  2. Select "Page". Apply the changes.

  3. Click "Attachment position:Before".

  4. Select "After". Apply the changes.

7. Review your changes

  1. Click the Save button to save your changes.

  2. Return to the Employment news page and review the changes.

  3. You may create more Jobs content to test it. Make sure you publish any new content before reviewing the Employment news page.

Showing 3 jobs, the more jobs
Showing the edit button in the Views listing page
Showing preview results
Highlighting the Attachment display tab
Field settings
Attachment style settings
Attachment row style settings
Title field in View
Adding content to global text area
Preview of new header
Pager options settings
Attach to "not defined" link
Select Page
Image of Position: After
Final Views page