Context Sensitive Views
One of the most powerful features of Periscope is that views are context sensitive. That means that one view can be reused across different contexts (such as sites) which can save configuration time as well as help tell a story about how the data changes. In this document I'll walk you through setting up a context sensitive dashboard (View) that can be reused across all sites.
Step 1: Create a new Dashboard View
The first thing we'll do is create a new Dashboard view that is assigned to all sites. To do this, navigate to your View Settings page or click the button in the bottom left of Periscope. The "Select View" dialog will appear, choose the "Dashboard" view and click OK. The next dialog that appears allows us to configure our view.
In the above dialog I set the name to "Site Dashboard", chose a new icon of a building and set the Target to All Sites. This caused our new view to appear on every site in our database. Now if we navigate to a Site we should see a building icon on the left which takes us to our new Dashboard view.
Step 2: Creating context sensitive viewlets
Now that we have a dashboard that is being reused across all of our sites we need to setup viewlets that are context sensitive. As we change from one site to another we want our viewlets to change as well. To do this:
- Click the small + button in the top right to add a new viewlet and choose the Multi Chart Viewlet.
- Click on the wrench within the viewlet to configure the viewlet, and expand the "Left" axis config section.
- Click on the "Data" button to choose which trends are showing on our left axis
- Change the Mode to Query
- Set the query to energy and press enter to preview the query results
- Click the "context" tag on the far right of the Query field
In the above example my chosen context is the site Barnard and the query returned one result as expected. The query is a Haystack Filter which contains a variable of "context". This is the only dynamic variable available in Periscope today and it can be used to insert the ID of the current context.