Tycoon, в XSL-шаблоне используйте для вызова тэмплейта следующий блок:
<xsl:call-template name="for">
<xsl:with-param name="items_on_page" select="items_on_page" />
<xsl:with-param name="current_page" select="current_page" />
<xsl:with-param name="count_items" select="count_items" />
<xsl:with-param name="visible_pages" select="3" />
</xsl:call-template>
В качестве значения параметра visible_pages укажите нужное Вам значение отображаемых ссылок. Сам тэмплейт:
<!-- Цикл для вывода строк ссылок -->
<xsl:template name="for">
<xsl:param name="i" select="0" />
<xsl:param name="items_on_page" />
<xsl:param name="current_page" />
<xsl:param name="count_items" />
<xsl:param name="visible_pages" />
<xsl:variable name="n" select="$count_items div $items_on_page" />
<!-- Считаем количество выводимых ссылок перед текущим элементом -->
<xsl:variable name="pre_count_page">
<xsl:choose>
<xsl:when test="$current_page > ($n - (round($visible_pages div 2) - 1))">
<xsl:value-of select="$visible_pages - ($n - $current_page)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Считаем количество выводимых ссылок после текущего элемента -->
<xsl:variable name="post_count_page">
<xsl:choose>
<xsl:when test="0 > $current_page - (round($visible_pages div 2) - 1)">
<xsl:value-of select="$visible_pages - $current_page - 1" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="round($visible_pages div 2) = ($visible_pages div 2)">
<xsl:value-of select="$visible_pages div 2" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$count_items > $items_on_page and $n > $i">
<!-- Ставим ссылку на страницу-->
<xsl:if test="$i != $current_page">
<!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
<xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
<!-- Определяем группу для формирования адреса ссылки -->
<xsl:variable name="group_link"><xsl:choose>
<!-- Если группа не корневая (!=0) -->
<xsl:when test="$parent_group_id != 0"><xsl:value-of select="/shop//group[@id=$parent_group_id]/fullpath"/></xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose></xsl:variable>
<!-- Определяем адрес ссылки -->
<xsl:variable name="number_link"><xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="$i != 0">page-<xsl:value-of select="$i+1"/>/</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose></xsl:variable>
<!-- Передаем фильтр -->
<xsl:variable name="filter">
<xsl:choose>
<xsl:when test="/shop/apply_filter/node()">?action=apply_filter&producer_id=<xsl:value-of select="/shop/producer_id"/>&saller_id=<xsl:value-of select="/shop/saller_id"/>&price_from=<xsl:value-of select="/shop/price_from"/>&price_to=<xsl:value-of select="/shop/price_to"/>&on_page=<xsl:value-of select="/shop/on_page"/>
<xsl:if test="/shop/property_xml/node()">
<!-- GET для доп. свойств -->
<xsl:value-of select="/shop/property_xml"/>
</xsl:if>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем первый символ вопрос или амперсанд -->
<xsl:variable name="first_symbol">
<xsl:choose>
<xsl:when test="$filter != ''">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Данные для стрелок сортировки -->
<xsl:variable name="arrows">
<xsl:choose>
<xsl:when test="(/shop/sort_by_field = 1) or (/shop/sort_by_field = 2)">
<xsl:choose>
<!-- Стрелка вверх -->
<xsl:when test="/shop/order_direction = 'ASC'"><xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&order_direction=1</xsl:when>
<!-- Стрелка вниз -->
<xsl:otherwise><xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&order_direction=2</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Выводим ссылку на первую страницу -->
<xsl:if test="$current_page - $pre_count_page > 0 and $i = 0">
<a href="{/shop/path}{$group_link}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">←</a>
</xsl:if>
<xsl:choose>
<xsl:when test="$i >= ($current_page - $pre_count_page) and ($current_page + $post_count_page) >= $i">
<!-- Выводим ссылки на видимые страницы -->
<a href="{/shop/path}{$group_link}{$number_link}{$filter}{$arrows}" class="page_link"><xsl:value-of select="$i + 1" /></a>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<!-- Выводим ссылку на последнюю страницу -->
<xsl:if test="$i+1 >= $n and $n > ($current_page + 1 + $post_count_page)">
<xsl:choose>
<xsl:when test="$n > round($n)">
<!-- Выводим ссылку на последнюю страницу -->
<a href="{/shop/path}{$group_link}{$number_link}{$filter}{$arrows}page-{round($n+1)}/" class="page_link" style="text-decoration: none;">→</a>
</xsl:when>
<xsl:otherwise>
<a href="{/shop/path}{$group_link}{$number_link}{$filter}{$arrows}page-{round($n)}/" class="page_link" style="text-decoration: none;">→</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if>
<!-- Не ставим ссылку на страницу-->
<xsl:if test="$i = $current_page">
<span class="current"><xsl:value-of select="$i+1"/></span>
</xsl:if>
<!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
<xsl:call-template name="for">
<xsl:with-param name="i" select="$i + 1" />
<xsl:with-param name="items_on_page" select="$items_on_page" />
<xsl:with-param name="current_page" select="$current_page" />
<xsl:with-param name="count_items" select="$count_items" />
<xsl:with-param name="visible_pages" select="$visible_pages" />
</xsl:call-template>
</xsl:if>
</xsl:template>