Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-09-28 19:53:45
- Fede
- Member
- From: BA
- Registered: 2009-09-28
- Posts: 10
looking for a tested pagination script
as discussed on this post How group links and files by pages we can’t paginate list links or files like articles. The solution appears to be using a jquery plugin.
Ive tried out a couple of them (eg jquery pagination and SimplePager ) but noone seems to work properly under textpattern…
So I was wondering if someone has already done that, and could please be so kind and post his experience here.
THANKYOU!
Offline
Re: looking for a tested pagination script
hello (hola máquina),
let’s go into the details: what have you tried and what didn’t work?
I ask because TXP output (the HTML that is sent to the browser) is pretty flexible, and making a jQuery plugin work with TXP is a matter of getting the right HTML output.
In other words, this shouldn’t (usually) be a problem with TXP itself but more a HTML/CSS/JS issue, that is, of getting it right so the magic works as expected.
So, if you could paste here what TXP code you are using, what’s the resulting output and what is failing, I believe you will be able to tackle this issue down in no time.
Offline
#3 2009-09-28 21:58:06
- Fede
- Member
- From: BA
- Registered: 2009-09-28
- Posts: 10
Re: looking for a tested pagination script
Que hacé lagarto!
Your right, Im pretty sure its a jQ script issue.
Thats why im looking for a proved script that allows paging between files and links lists… Have you ever done that?
Offline
Re: looking for a tested pagination script
Using the demo code provided with the jquery pagination download and a page with the following it works for me.
<html>
<head>
<link rel="stylesheet" href="/css/pagination.css" />
<script type="text/javascript" src="/textpattern/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.pagination.js"></script>
<script type="text/javascript">
// This is a very simple demo that shows how a range of elements can
// be paginated.
/**
* Callback function that displays the content.
*
* Gets called every time the user clicks on a pagination link.
*
* @param {int}page_index New Page index
* @param {jQuery} jq the container with the pagination links as a jQuery object
*/
function pageselectCallback(page_index, jq){
var new_content = $('#hiddenresult div.result:eq('+page_index+')').clone();
$('#Searchresult').empty().append(new_content);
return false;
}
/**
* Callback function for the AJAX content loader.
*/
function initPagination() {
var num_entries = $('#hiddenresult div.result').length;
// Create pagination element
$("#Pagination").pagination(num_entries, {
num_edge_entries: 2,
num_display_entries: 8,
callback: pageselectCallback,
items_per_page:1
});
}
// Load HTML snippet with AJAX and insert it into the Hiddenresult element
// When the HTML has loaded, call initPagination to paginate the elements
$(document).ready(function(){
initPagination();
});
</script>
</head>
<body>
<h1>jQuery Pagination Plugin Demo</h1>
<div id="Pagination" class="pagination">
</div>
<br style="clear:both;" />
<div id="Searchresult">
This content will be replaced when pagination inits.
</div>
<div id="hiddenresult" style="display:none;">
<txp:file_download_list limit="10" sort="downloads desc" break="">
<div class="result"><p>
<txp:file_download_name /> [<txp:file_download_size format="mb" decimals="2" />]
</p></div>
</txp:file_download_list>
</div>
</body>
</html>
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#5 2009-09-29 13:02:11
- Fede
- Member
- From: BA
- Registered: 2009-09-28
- Posts: 10
Re: looking for a tested pagination script
MattD wrote:
Using the demo code provided with the jquery pagination download and a page with the following it works for me.
Matt, thankyou, however it doesn’t show more that one item at a time, even when you change the “items_per_page:1
“ variable… I am wrong? :/
Offline
Re: looking for a tested pagination script
You’re right and I can’t figure out why. And it looks like quickPager doesn’t work with jQuery 1.3.2
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#7 2009-09-29 19:05:47
- Fede
- Member
- From: BA
- Registered: 2009-09-28
- Posts: 10
Re: looking for a tested pagination script
:’(
any suggestions?
Offline
#8 2009-09-30 06:38:44
- kostas45
- Member
- From: Greece
- Registered: 2007-11-08
- Posts: 61
Re: looking for a tested pagination script
Have you checked smd_pagicle?
Offline
Re: looking for a tested pagination script
Maquinola,
try using quotation marks around the values on simplePager.
Like this:
num_edge_entries: '2',
num_display_entries: '8',
items_per_page:'1'
Offline