Paginating A Block Other Than Page_List
Permalink
BACKGROUND:
I've got a bunch of entries sitting in a autonav block template. It would be nice if they could be paginated i.e. (only 5 or so results appearing per page).
Similar to the page_list block, the entries are already sitting in an array.
QUESTION:
1. Is there a way to load the features of page_list's pagination in a different block (or even a template page on it's own)?
NOTES:
Are any of these loaders be helpful?:
setItemsPerPage(5) can be used to display the number of results.
I had a read through
http://www.concrete5.org/documentation/developers/system/searching-...
2. Should I be extending the DatabaseItemList?
- if so with what function?
Any help is greatly appreciated! I'm sure this would be a nice addon for others too.
I've got a bunch of entries sitting in a autonav block template. It would be nice if they could be paginated i.e. (only 5 or so results appearing per page).
Similar to the page_list block, the entries are already sitting in an array.
QUESTION:
1. Is there a way to load the features of page_list's pagination in a different block (or even a template page on it's own)?
NOTES:
Are any of these loaders be helpful?:
Loader::library('item_list'); Loader::model('page_list'); Loader::helper('pagination'); Loader::controller('page_list');
setItemsPerPage(5) can be used to display the number of results.
I had a read through
http://www.concrete5.org/documentation/developers/system/searching-...
2. Should I be extending the DatabaseItemList?
- if so with what function?
class ArticleSearchList extends DatabaseItemList { public function pagArticles() { ...? } }
Any help is greatly appreciated! I'm sure this would be a nice addon for others too.
like this
Viewing 15 lines of 32 lines. View entire code block.
ups, sorry, I haven't realized that I had a filter in the forum and was looking at a post from 2010.. At least we have an answer now ;-)
Any idea how I could paginate this?
<?php //Blog archives list echo '<h4>News/Blog Archive</h4><div style="font-size:13px;">' ; $nav = BlockType::getByHandle('autonav'); $nav->controller->orderBy = 'display_asc'; $nav->controller->displayPages = 'custom'; $nav->controller->displayPagesCID = '119'; $nav->controller->displaySubPages = 'relevant'; $nav->render('view'); echo '</div>' ; ?>
You're mixing two different things, the PageList mentioned in this discussion is a class, not a block. It's meant for developers to be able to build their own add-ons.
There's no easy way to do what you want. You'd probably have to build your own block.
There's no easy way to do what you want. You'd probably have to build your own block.
Drat. I wish I understood anything. Thanks, I'll go look for a block-making tutorial. I've seen one before, but it was above my head then and probably still is, but I'll give it a shot.
In the meantime, if you're still around and feel like answering, do you have any idea if there's a standard sort of Blog Archive that shows more than just months which click to a special "month page?" I want something like an accordion where you can click "January" and then see all the January blog article links in the sidebar rather than jumping to a January page.
In the meantime, if you're still around and feel like answering, do you have any idea if there's a standard sort of Blog Archive that shows more than just months which click to a special "month page?" I want something like an accordion where you can click "January" and then see all the January blog article links in the sidebar rather than jumping to a January page.
Doesn't the date nav block do pretty much what you're looking for? I've attached a screenshot where you can see "markus", an actual page you can jump to without the need of a special "month page"
hm, maybe it does! I've never used or even noticed the date block before. It automagically "hitches up" to the blog?
Give it a try, you only have to select the page type, probably "Blog Entry" and you'll immediately see how it looks
Wow, I'm looking at it now. Looks like exactly what I need. Thank you!