Jump to content

4.Как выделить активную ссылку сортировки


Recommended Posts

К примеру выбрали сортировку - "цена по возрастанию" и идеале как то должно показывать что сейчас сортировка именно такая.

Как то ее облачить в какой то тег типа <span>цена по возрастанию</span>

Кто нибудь делал?

Где копать?

Link to post
Share on other sites
support

По умолчанию нет кода для выделения.

Разве что может в /includes/modules/default.php писать свой код.

Link to post
Share on other sites
shaklov

Через url страницы ведь можно получить параметр и в смарти вставить.

Ищем вот это "sort=price&direction=asc" и назначаем класс.

Было на форуме: http://vamshop.ru/forum/topic/7109-как-выделить-в-шаблоне-выбранный-параметр-сорт/page__p__60378__hl__sort%3Dprice__fromsearch__1#entry60378

Link to post
Share on other sites

то есть получается такая конструкция? вроде работает но мало ли )

<div class="sort_block">
{#text_sort#}
<a {if $smarty.get.sort == 'name' & $smarty.get.direction == 'asc'}class="active"{/if} href="{$LINK_sort_name_asc}">{#text_sort_name_asc#}</a> |
<a {if $smarty.get.sort == 'name' & $smarty.get.direction == 'desc'}class="active"{/if} href="{$LINK_sort_name_desc}">{#text_sort_name_desc#}</a> |
<a {if $smarty.get.sort == 'price' & $smarty.get.direction == 'asc'}class="active"{/if} href="{$LINK_sort_price_asc}">{#text_sort_price_asc#}</a> |
<a {if $smarty.get.sort == 'price' & $smarty.get.direction == 'desc'}class="active"{/if} href="{$LINK_sort_price_desc}">{#text_sort_price_desc#}</a>
</div>[/code]

Link to post
Share on other sites
  • 1 year later...
KoVaLsKy

Как то же самое но провернуть с числом товаров на странице?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...