Added automatic replacement of tvs in "sortby" parameter
Added conditional tpls