I recently stumbled on a case where the customer wanted to filter a Document Library on Content Type with links places above the List View Web Part.
When filtering the list out-of-the-box, SharePoint uses the URL, and the hash looks similiar to this:
#InplviewHash[Name of the view]=FilterField1%3D[Field]-FilterValue1%3D[Value]
The name of the view will change from page to page, so it’s hard to make that dynamic. Because of this I had to look for other ways.. and I found one.
If you use the following:
It works.. almost..
The problem now is that it will filter all views on the page. For this concrete customer case that’s good enough, but I’m looking for a more “complete” solution for future cases.. This solution probably involves retrieving the view name with REST.