I use a view to display a list of books sorted by title. The view has a contextual filter to limit the list by topic. So, a link to the view might be
/books-by-title/34 where 34 is the taxonomy term id for "self-help". The result is a list of self-help books in title order. Works great.
The user may also want to view the same books in popularity order, so I include a menu in the view header, one choice being "By Popularity". The menu link needs to be
How do I pass the term id (34) from the URL into the menu link?
Seems like this should be easy, but after reading a dozen articles and trying several approaches, no success.
I should note that a given book be assigned more than one topic. For example, a "self-help" book may also be classified as being about "exercise". So I can't get the term id simply by looking at the topic field of the book.