public function generateSortingLink($field, $sortByDir)
    {
        $params = array();
        $params['sortByField'] = $field;
        $params['sortByDir'] = $sortByDir;

        foreach ($params as $key => $value) {
            $params[$key] = $this->cObj->wrap($value, $this->pObj->prefixId . '[' . $key . ']=|');
        }

        $conf = array();
        $conf['parameter'] = $GLOBALS['TSFE']->id;
        $conf['addQueryString'] = '1';
        $conf['addQueryString.']['exclude'] = 'id,tx_kesearch_pi1[multi],cHash';
        $conf['additionalParams'] = '&' . implode('&', $params);

        return $this->cObj->typoLink(
            $this->pObj->pi_getLL('orderlink_' . $field, $field),
            $conf
        );
    }