Context Variables to show/hide blocks

context-variables

#1

Is it possible to use context variables to either show or not show a specific block depending on an arbitrary attribute value?


#2

Not possible in the current feature set, sorry.

The best workaround I can suggest is, if you’re serving these dashboards us as experience pages, you could do the following:

  1. Clone the dashboard in question (you can do that from your dashboards list) and remove the block from the cloned version.
  2. Set up two experience pages, where one serves the dashboard with the block and the other serves the dashboard without.
  3. When responding to your endpoint requests, serve one page or the other via the Endpoint Reply Node based on the presence of a certain query parameter or context value.

#3

Hi Guys

Wondering if there is anything new in the platform that might make it easier to use customer specific parameters to show/hide dashboard blocks?

Thanks!


#4

This is something I would also be interested in, would be very helpful as we our devices have varying featuresets.


#5

@Dylan_Schuster

Just revisiting this topic and your workaround above. I’m wondering if two experience pages would really be required? Could we not just dynamically serve up different versions of a dashboard by passing difference dashboardIds through pageData using handlebars in the experience page setup?


#6

Actually yes, you could do that since the dashboardId field on an experience dashboard page is templatable. You could pull that ID off of something in the web request - like a path parameter or a query parameter - or off the user object, or off a property set in the workflow that is responding to the request.


#7

There is still the issue of having to keep to similar dashboards (one a subset of the other) in sync over time.