The Pagelist plugin is a universal solution that may be used to build widgets, virtual page lists and navigation. The plugin enables you to complete the following tasks:
The Pagelist plugin is essentially a function and is used via callbacks:
function pagelist( $tpl = 'pagelist', $items = 20, $order = 'page_date DESC', $condition = '', $cat = '', $blacklist = '', $whitelist = '', $sub = true, $pagination = 'pld', $noself = false, $offset = 0 )
The callback parameters are as follows:
The plugin uses the pagelist function to build own template in the specified placeholder. Due to this feature it enables website developer to build such blocks as blog feeds, recent items / top items widgets etc.
Build blog feed – selec t pages from all categories except system and archives, sort by date ASC and build pagination with 8 elements per page:
{PHP|pagelist('pagelist.blog','8','page_date DESC','','','system;archives','','TRUE')}
Build “Top-3” widget – 3 pages with non-zero hits sorted by hits DESC except pages from the system category:
{PHP|pagelist('pagelist.top','3','page_count DESC','page_count != "0"','','system','','')}
Build “About us” widget – 1 page with about alias from the system category:
{PHP|pagelist('pagelist.about','','','page_alias = "about"','system','','','')}
The model template has the following format:
<!-- BEGIN: MAIN --> <ul> <!-- BEGIN: PAGE_ROW --> <li><a href="{PAGE_ROW_URL}">{PAGE_ROW_TITLE}</a></li> <!-- END: PAGE_ROW --> </ul> <!-- IF {PAGE_TOP_PAGINATION} --> <div class="pagination"> {PAGE_TOP_PAGEPREV} {PAGE_TOP_PAGINATION} {PAGE_TOP_PAGENEXT} </div> <!-- ENDIF --> <!-- END: MAIN -->
The PAGE_ROW_ regular block is used to output elements generated with the cot_generate_pagetags() function prefixed with PAGE_ROW_.
The following additional tags are available:
Once Comments plugin linkage is enabled in the config the following tags become available: PAGE_ROW_COMMENTS and PAGE_ROW_COMMENTS_COUNT.
Feel free to discuss the plugin at our forums: Pagelist Plugin or fork on github
Thanked: 27 раз
Подскажите как выводить список новостей просто с TITLE новости, а то у меня получается хлебные крошки:
1. категория / подкатегория / новость
хочу получить
1. новость
Спасибо
Thanked: 27 раз
Нашел PAGE_ROW_SHORTTITLE
Как выводить все, кроме самого последнего поста категории?
Thanked: 217 раз
Наверно для такого лучше всего написать свой миниплагин )
Thanked: 2 рази
Как на счет кеширования информации?
Thanked: 181 раз
For more complex needs you can use `cot_page_enum()` function (available for Cotonti 0.9.19 Page API)
Thanked: 217 раз
Плагин обновился: добавилась опция offset (по просьбе pasha_link)
Thanked: 27 раз
как пользоватся i18n ? А то перевод есть, в запросе вижу выборку но на странице показывает основной язык а не перевод
Thanked: 27 раз
Для корректной работы перевода у себя вот тут добавил:
global $i18n_enabled, $i18n_read;
$i18n_enabled = $i18n_read && cot_i18n_enabled($row['page_cat']);