Views arguments by either nodequeue or taxonomy in panel. Change sort based on which argument
Hey guys. I've got a view setup that has two arguments: Nodequeue ID and Taxonomy Term Id.
I've got the view set this way so that we can use one view inserted into a panel page so the end user can use the view as a nodequeue or a taxonomy term. For instance if they want nodequeue they enter 1/* for the argument if they want a taxonomy term they enter */5 or whatever the TID is.
The actual arguments work find but I run into a problem with the sorting. Sorting is set by nodequeue position then post date. When a node is in multiple node queues and your argument is for taxonomy */TID then you get the node appearing multiple times. Remove the nodequeue sort and it works fine.
I'd like to be able to change my sort criteria based on which argument is present to avoid this duplication. The view is set to distinct and their is a relationship for nodequeue added.
From what I've Googled and read around here on d.o is that this can probably be done via custom argument handling code but mostly everything I've read about that is for D5 and Views 1.
I know the option exists to create to different displays or views, one for argument nodequeue and one for taxonomy but it seems there's gotta be a better way for this. Does anyone have any ideas? I appreciate any of your help.

So adding to this I did some
So adding to this I did some things to try and remove the queue position from sort and then just sorting in the tpl.php if it is a nodequeue. To do this though I needed to pull the nodequeue position in as a field. As soon as I add queue position as a field I run into the duplication again. Is there anyway in a view to give the ability to power it by either a taxonomy term or nodequeue without duplication?
----
Kevin Basarab
http://kbasarab.com | http://jacksonville.com
SQL
Apparently the only difference in the queries also is the one select statement:
SELECT DISTINCT(node.nid) AS nid, node.title AS node_title, node.created AS node_created, node.changed AS node_changed, DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL -14400 SECOND), '%Y%m%d%H%i') AS node_created_minute FROM node node LEFT JOIN nodequeue_nodes nodequeue_nodes_node ON node.nid = nodequeue_nodes_node.nid WHERE (node.status <> 0) AND (node.created <= ***CURRENT_TIME***+0) AND (node.type in ('video')) AND (node.vid IN ( SELECT tn.vid FROM term_node tn WHERE tn.tid = 1892 )) ORDER BY node_created_minute DESC
vs
SELECT DISTINCT(node.nid) AS nid, node.title AS node_title, node.created AS node_created, node.changed AS node_changed, nodequeue_nodes_node.position AS nodequeue_nodes_node_position, DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL -14400 SECOND), '%Y%m%d%H%i') AS node_created_minute FROM node node LEFT JOIN nodequeue_nodes nodequeue_nodes_node ON node.nid = nodequeue_nodes_node.nid WHERE (node.status <> 0) AND (node.created <= ***CURRENT_TIME***+0) AND (node.type in ('video')) AND (node.vid IN ( SELECT tn.vid FROM term_node tn WHERE tn.tid = 1892 )) ORDER BY node_created_minute DESC
----
Kevin Basarab
http://kbasarab.com | http://jacksonville.com