After several days trying to achieve this i have concluded that it's not possible. The global $#view_parameters variable is not available in custom tags templates, but since it IS available in content/datatype/view/ezxmltext.tpl template I think this is a bug. So I have reported it here: