SidebarToggle button in dataview

Is there a way to get the SidebarToggle button inside a dataview (or any other way to pass data to it?). My button shows a shopping cart, and I would like to show a different button of the shopping cart is empty. I guess I need to place this button in a dataview but I can't seem to arrange a way to show the sidebar toggle button in a data view (or snippet)
1 answers

I've done something like this previously by:

  • Using an empty/transparent icon for the sidebar button
  • Creating conditionally visible images in a snippet included in my layout. That snippet had a datasource microflow to get the object I needed to reference
  • CSS'd conditionally visible images under the clickable area where the sidebar button actually is