Staff Picks View - Single Page
Create a block that rotates a randomly-chosen book from the Staff Picks page.
CREATE A PAGE
Navigate to: Content > Add Content > Page
- Fill in ‘Name’ - Example: ‘Staff Picks’
- Enter ISBNs for staff picks (we recommend starting with at least 2)
IMPORTANT NOTES BEFORE STARTING YOUR VIEW SETUP:
- Retrieve the NID (node ID) of the page (Staff Picks), you will need it for step 23 of creating your view. This can be found in the URL for editing the node so click on Content > Find the ‘Staff Picks’ page and click edit. Look at the URL and make note of the NID. Example: node/111/edit
- We highly recommend you save your 'view' after every step, as you create it. Especially when you see this message come up: “* All changes are stored temporarily. Click Save to make your changes permanent. Click Cancel to discard the view.”
- When working in settings, always change the ‘For’ option from ‘All Displays’ to ‘This block (override)’ so that the changes you make only alter the block (or page) you are working on.
CREATE THE VIEW
Navigate to: Structure > Views > Add New Views
- Fill in Description - Example: Staff Picks Block
- Fill in ‘View Name” - Example: staff_picks_block
- Uncheck ‘Create A Page’
- Select ‘Create A Block’
- Enter Block Title should automatically fill in with your view name, if it does not, repeat it.
- Display format - leave it as ‘unformatted list’ of ‘titles (linked)’
- Set ‘Items per page’ to 1
- Select Continue and Edit
- Click on ‘Block’ under ‘Display Name”
- Enter name and description Example: (Staff Picks Block, Block for providing rotating staff picks) - click Apply
- Confirm ‘Format’ is set to ‘Unformatted list’ and its settings have ‘Add views rows classes and Add striping (odd/even), first/last row classes’ selected.
- Click Apply (this display)
- Under Fields - Click Add
- Find ‘Content : Books’ in list - Select - Apply (this display)
- Configure Books - uncheck ‘Create a label’
- Select the appropriate ‘Formatter’ (for this example we are using ‘Basic - Without Buy Button'
- Multiple Field Settings - Uncheck Display all values in same row
- Apply (this display)
- Under fields click on ‘Content : Title’ - Remove
- Under ‘Filter Criteria’ Add - ‘Content: Type’ - Apply (this display)
- Select ‘Page’ under ‘Content Type’ - Apply (this display)
- Under ‘Filter Criteria’ Add - ‘Content : nid’
- Enter NID that you previously made note of from the Staff Picks page into the ‘Value’ field - Apply (this display), Example: 111
- Under Sort Criteria - Add - ‘Global - Random’ - Apply - Apply (this display)
- Under Sort Criteria - Click on - Content Post Date - Remove
- Save View
The Staff Picks Block view is now ready, and will be available in the list of blocks. You can activate this block from Structure > Blocks and place it in a suitable region.