Russian TYPO3 community Форум больше не используется. Присоединяйтесь к каналу #community-ru в Slack for TYPO3 community  

Вернуться   Russian TYPO3 community > Обсуждение общих технических вопросов > Общие вопросы

Ответ
 
Опции темы Опции просмотра
Старый 22.01.2016, 13:23   #1
iMoD
Новенький
 
Регистрация: 20.01.2016
Сообщений: 19
По умолчанию Пагинация

Добрый день, может кто подсказать или дать пример как сделать пагинацию контента, если в БД таблица с данными к примеру товары.

Нашел расширения, кто та с ними работал ?

http://typo3.org/extensions/reposito...L=0&q=paginate
iMoD вне форума   Ответить с цитированием
Старый 22.01.2016, 15:27   #2
Николай Сипко
Senior Member
 
Регистрация: 17.09.2012
Сообщений: 675
По умолчанию

Цитата:
Сообщение от iMoD Посмотреть сообщение
Нашел расширения, кто та с ними работал ?

http://typo3.org/extensions/reposito...L=0&q=paginate
readme.txt
==========
First we need to declare name space in your template file

=> {namespace pg=JS\JsPaginate\ViewHelpers}

then after we can use following pagination script. and need to add our records [ array ] in objects

<pg:Paginate objects="{faq}" as="paginatedObject" configuration="{itemsPerPage: 5, insertAbove: 1, insertBelow: 1, maximumVisiblePages: 5}">
<div class="faq-list">
<f:for each="{paginatedObject}" as="list" iteration="itemIteration">
<div class="even {f:if(condition: itemIteration.isOdd , then: 'odd')}">
{paginatedObject.title}
</div>
</f:for>
</div>
</pg:Paginate>

/*********************************** Pagination Configuration ************************************************** ****/

1) itemsPerPage = 5
5 records will display on first page

2) insertAbove = 1
if insertAbove is true then pagination will display before content

3) insertBelow = 1
if insertAbove is true then pagination will display after content

4) maximumVisiblePages = 5
Maximum Visible Pages 5 in pagination.

setup.text
==========
plugin.tx_jspaginate {
settings{
hideDotInNavigation = {$plugin.tx_jspaginate.settings.hideDotInNavigatio n}
}
}

constants.txt
=============
plugin.tx_jspaginate {
settings{
hideDotInNavigation = 0
}
}

А что непонятно?
Николай Сипко вне форума   Ответить с цитированием
Старый 25.01.2016, 11:28   #3
iMoD
Новенький
 
Регистрация: 20.01.2016
Сообщений: 19
По умолчанию

Цитата:
Сообщение от Николай Сипко Посмотреть сообщение
readme.txt
==========
First we need to declare name space in your template file

=> {namespace pg=JS\JsPaginate\ViewHelpers}

then after we can use following pagination script. and need to add our records [ array ] in objects

<pg:Paginate objects="{faq}" as="paginatedObject" configuration="{itemsPerPage: 5, insertAbove: 1, insertBelow: 1, maximumVisiblePages: 5}">
<div class="faq-list">
<f:for each="{paginatedObject}" as="list" iteration="itemIteration">
<div class="even {f:if(condition: itemIteration.isOdd , then: 'odd')}">
{paginatedObject.title}
</div>
</f:for>
</div>
</pg:Paginate>

/*********************************** Pagination Configuration ************************************************** ****/

1) itemsPerPage = 5
5 records will display on first page

2) insertAbove = 1
if insertAbove is true then pagination will display before content

3) insertBelow = 1
if insertAbove is true then pagination will display after content

4) maximumVisiblePages = 5
Maximum Visible Pages 5 in pagination.

setup.text
==========
plugin.tx_jspaginate {
settings{
hideDotInNavigation = {$plugin.tx_jspaginate.settings.hideDotInNavigatio n}
}
}

constants.txt
=============
plugin.tx_jspaginate {
settings{
hideDotInNavigation = 0
}
}

А что непонятно?
setup.text, constants.txt

где эти файлы находятся ?

objects="{faq}"

Где создается данный объект ? в тайпо скрипте ? или в файле ? можно пример если не трудно.
iMoD вне форума   Ответить с цитированием
Старый 25.01.2016, 13:16   #4
Николай Сипко
Senior Member
 
Регистрация: 17.09.2012
Сообщений: 675
По умолчанию

Цитата:
Сообщение от iMoD Посмотреть сообщение
Где создается данный объект ? в тайпо скрипте ? или в файле ? можно пример если не трудно.
Устанавливаем расширение js_paginate
http://typo3ua.com/extensions/ustanovka-rasshirenij/
=======
Находим в /var/www/typo6/typo3conf/ext/js_paginate
=======
Читаем readme.txt:
First we need to declare name space in your template file
(Во-первых, мы должны объявить пространство имен в вашем ФАЙЛЕ ШАБЛОНА)
Вставляем "пространство имен в файл шаблона"
=> {namespace pg=JS\JsPaginate\ViewHelpers}
=======
then after we can use following pagination script. and need to add our records [ array ] in objects
(после этого можно использовать следующие нумерации страниц сценария. и нужно добавить ваши записи http://php.net/manual/ru/language.types.array.php в объекты)
=======
Если нужно, изменяем в pagination script цифры Configuration

Последний раз редактировалось Николай Сипко; 25.01.2016 в 13:56
Николай Сипко вне форума   Ответить с цитированием
Старый 25.01.2016, 14:04   #5
iMoD
Новенький
 
Регистрация: 20.01.2016
Сообщений: 19
По умолчанию

<pg:Paginate objects="{0: '1',1: '2',2: '3', 3: '4'}"

с таким примером делал, но сама пагинация не работает

index.php?id=11&tx__%5B%40widget_0%5D%5BcurrentPag e%5D=2&cHash=e9ec68e3bb01b05376b30d78560fc617
iMoD вне форума   Ответить с цитированием
Старый 25.01.2016, 15:18   #6
Николай Сипко
Senior Member
 
Регистрация: 17.09.2012
Сообщений: 675
По умолчанию

Цитата:
Сообщение от iMoD Посмотреть сообщение
<pg:Paginate objects="{0: '1',1: '2',2: '3', 3: '4'}"

с таким примером делал, но сама пагинация не работает
use following pagination script?

<pg:Paginate objects="{faq}" as="paginatedObject" configuration="{itemsPerPage: 5, insertAbove: 1, insertBelow: 1, maximumVisiblePages: 5}">
<div class="faq-list">
<f:for each="{paginatedObject}" as="list" iteration="itemIteration">
<div class="even {f:if(condition: itemIteration.isOdd , then: 'odd')}">
{paginatedObject.title}
</div>
</f:for>
</div>
</pg:Paginate>
Николай Сипко вне форума   Ответить с цитированием
Ответ


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB code is Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход


Часовой пояс GMT +4, время: 02:42.


Работает на vBulletin® версия 3.8.1.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot

Хостинг и техническая поддержка: TYPO3 Лаборатория