public function renderSorting(&$fluidTemplateVariables)
    {
        $links = '';
        // show sorting:
        // if show Sorting is activated in FlexForm
        // if a value to sortBy is set in FlexForm (title, relevance, sortdate, what ever...)
        // if there are any entries in current search results
        if ($this->conf['showSortInFrontend'] && !empty($this->conf['sortByVisitor']) && $this->pObj->numberOfResults) {
            // loop all allowed orderings
            foreach ($this->sortBy as $field) {
                // we can't sort by score if there is no sword given
                if ($this->pObj->sword != '' || $field != 'score') {
                    $sortByDir = $this->getDefaultSortingDirection($field);
                    $dbOrdering = GeneralUtility::trimExplode(' ', $this->db->getOrdering());

                    /* if ordering direction is the same change it
                     *
                     * Explanation:
                     * No ordering is active. Default Ordering by db is "sortdate desc".
                     * Default ordering by current field is also "sortdate desc".
                     * So...if you click the link for sortdate it will sort the results by "sortdate desc" again
                     * To prevent this we change the default ordering here
                     */
                    if ($field == $dbOrdering[0] && $sortByDir == $dbOrdering[1]) {
                        $sortByDir = $this->changeOrdering($sortByDir);
                    }

                    $url = $this->generateSortingLink($field, $sortByDir);
                    $classname = $this->getClassNameForUpDownArrow($field, $dbOrdering);

                    $fluidTemplateVariables['sortingLinks'][] = array(
                        'field' => $field,
                        'url' => $url,
                        'class' => $classname
                    );
                }
            }
        }
    }