S
S
Sergik_DS2019-06-19 14:50:17
1C-Bitrix
Sergik_DS, 2019-06-19 14:50:17

How to remove fixation of last page number in navigation?

The situation is this. The list of elements from the infoblock is obtained (using the - method CIBlockElement::GetList). The query results ( class object CIBlockResult) contain a parameter NavPageNomer(current page number), the page number is not explicitly specified (when querying elements). After clicking on links like /page/?PAGEN_1=<номер страницы>, the elements change - all the rules. When you go to /page/, the first page should load, BUT in the results ( NavPageNomer) the last one requested with PAGEN_1. What could be the problem?
PS
1) the navigation number is correct
2) caching has nothing to do with it, the /page/LAST requested one opens
3) the version of Bitrix, the component - does not play a role (there is a similar site where the same design works correctly)
4) PAGEN_1is not defined on/page/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Prilepa, 2019-06-20
@Sergik_DS

<?
// Пример запрещает сохранение в сессии номера последней страницы 
// при стандартной постраничной навигации.
// По умолчанию в сессии запоминается последняя открытая страница постраничной навигации. 
// Если вы хотите изменить такое поведение для данной текущей страницы, 
// то до вызова метода CDBResult::NavPrint необходимо воспользоваться следующим кодом:
CPageOption::SetOptionString("main", "nav_page_in_session", "N");

// Для того чтобы вернуть режим по умолчанию:
CPageOption::SetOptionString("main", "nav_page_in_session", "Y");
?>

https://dev.1c-bitrix.ru/api_help/main/reference/c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question