Exercise 6.3: A customised News and Media page
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.
Showing 3 jobs, the more jobs There are seven stages in this process:
Change the number of items to display
Add a new display: an attached list
Add a header to the attachment
Change the offset to exclude the first three articles
Change the attachment setting
1. Locate the View
Navigate to the admin/structure/views and edit the Employment news view.
2. Change the number of items to display
Under Pager click "mini" to change the settings.
Select "Display a specified number of items".
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.
At the top, click the +Add button and select "Attachment".
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.
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.Add a header to the attachment
Under the Header section on the View page click Add.
Make sure you’re editing "This attachment (override)".
Search for and select "Text area". Apply changes.
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:
Make sure you're still editing the Attachment display. Under the Pager settings in the centre column, click "10 items" to change the setting.
Change the “Items to display” to 7 and the "Offset" to 3. Apply the changes.
6. Change the attachment settings
Under "Attachment settings" in the centre column click the option: "Attach to:" Not defined.
Select "Page". Apply the changes.
7. Review your changes
Click the Save button to save your changes.
Return to the Employment news page and review the changes.
You may create more Jobs content to test it. Make sure you publish any new content before reviewing the Employment news page.