...
Islandora Solr Views is a small bit of extra functionality on Drupal Views. This Duraspace Islandora wiki doesn't cover Drupal in general, but for this specific module, it's very helpful to have worked through a tutorial through some tutorials about "Views" in Drupal 7, so you know the context and how Views are used to make a user interface. Views is heavily rooted in Drupal, and Islandora Solr Views brings in a bit more interaction with the Islandora objects on the site.
To enable Solr Views:
- Click to "Modules" and check that the following modules are enabled: "Drupal Views", "Drupal Views UI", "Islandor Solr Views", and "Islandora Solr Search" modules. If enabling any of those pops up a message about enabling dependent modules, then click yes to enabling those.
- Click to "People", then "Permissions", and check that your user account has permission to "Administer Views".
...
From here, most of the configuration and setup for your view is exactly the same as for any other view, with a few significant differences. Islandora Solr Views adds Solr indices to the FIELDS, FILTER CRITERIA and SORT CRITERIA sections.
Tutorial: Creating a block that contains the latest objects in a collection
Note |
---|
This tutorial assumes a fresh installation of Islandora with the default Solr and Gsearch setups, and that the Basic Image Solution Pack has been installed and contains images. |
...
Create a new
...
View
Click to "Structure" then "Views".
In the "Show" box, select "Islandora Solr".
When creating a new view, the option to
...
...
...
...
Uncheck "Create a Page". Check the box to "Create a Block".
- Click "Continue and Edit"
By default, a block will be created that contains no more than five items in an unformatted list. For this tutorial, these settings will be fine. Click 'Continue & Edit' to continue.
2. Remove the 'Islandora Solr: Score' field
Image Removed
...
Configure the Block:
...
" field by clicking on "Islandora Solr: Score" and then in the pop up box clicking "Remove".
In the top right corner, click "Save" to save the change.
Add the 'dc.title' field to FIELDS
...
...
...
...
...
...
...
".
For a small block, we probably don't want a label showing up for every object listed, so uncheck 'Create a label'.
Check the 'Link field to object' button to make sure each object is being linked to from the block.
Click 'Apply (all displays)' again to close the overlay.
...
- In the top right corner, click "Save" to save the change.
Add the 'RELS_EXT_isMemberOfCollection_uri_ms' field to FILTER CRITERIA
We want our objects to be filtered from a certain collection. RELS-EXT datastreams define this collection with the format 'info:fedora/namespace:collection_pid'. In the case of a standard installation of Islandora, the Basic Image Solution Pack will have the RELS-EXT isMemberOfCollection_uri_ms field 'info:fedora/islandora:sp_basic_image_collection'. At any time, you can check a collection's namespace:collection_pid by clicking the 'Manage' tab on that collection, and then clicking the
...
...
...
...
...
...
...
...
...
...
...
...
...
- In the top right corner, click "Save" to save the change.
- Add the 'fgs_createdDate_dt' field to SORT CRITERIA
- We would like to view only the latest objects created in our list, and if there are more than five objects total in the collection, we will need to have them sorted. The 'Islandora Solr: fgs_createdDate_dt' field will allow us to display only the five latest objects in our list.
- Beside 'SORT CRITERIA', click the 'add' button. Check off 'Islandora Solr: fgs_createdDate_dt' from the list, and click 'Apply (all displays)'.
- In order for the latest objects to show up on the top, we will need to sort them 'descending' instead of 'ascending', so on the next page, click the radio button beside 'Sort descending'. Click 'Apply (all displays)' again to close the overlay.
...
- Save the block and add it to part of the structure
- Click the 'Save' button at the top of the view editing page. This will add it to the list of blocks in your site's 'structure' section. You can add it to part of the structure by going to http://path.to.your.site/admin/structure/block, scrolling down to the 'Disabled' block section at the bottom, and adding it to one of the block regions.
- Check the View and see how it looks.
- Your new view will now show up in that region, listing all new images ingested into the Basic Image collection and providing links to those images. The below example is of a view block given the above setup, with the view name 'Image Feed', and a single image in that collection called 'Sample Image'.
Image Modified - If you want this block to appear on a Drupal page of its own, you can create a new Drupal node (basic page), then configure the block so it appears on "Only the listed pages" and add the name of that Drupal node. Finally, place a link to that node in one of the site's Drupal menus.
Configuration
The Islandora Solr Views module has no configuration options of its own, but pulls entries from the Solr index. Check the Islandora Solr section for more information on setting up Islandora Solr.