I have created a Term Set (Channels) which is marked as "Available for Tagging" and "use this term set for Site Navigation" and for its "Target Page Settings" I chose Topics.aspx in pages list. This Term Set contains some terms. I have configured the vertical navigation to use this Term Set. I have created a MyImages list which contains a Managed Metadata column that points to Channels Term set. All images within this MyImage list have been tagged by a term in Channels term set.
Now when you click an item in Vertical Navigation, I want to show only those images that have been tagged by same term as Navigation Item. When I have "Content Search Web Part" in Topics.aspx and its Query has been configured to use owstaxIdMetadataAllTagsInfo:{Term}, it works perfectly. but I want to use Keyword Query Language in my own web part. My problem is how can I get the name of the term when you click the navigation Item? (to use it in my KQL).