Fix blog pagination
This commit is contained in:
parent
58035b085f
commit
ebd1d4a227
|
@ -1,15 +1,32 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
?>
|
||||
|
||||
<script>
|
||||
$('.page-selection').twbsPagination({
|
||||
totalPages: <?= $pageCount; ?>,
|
||||
const pages = Math.ceil(parseFloat(<?= $pageCount ?>));
|
||||
$('.pagination').twbsPagination({
|
||||
visiblePages: 10,
|
||||
first: '<i class="fa fa-fast-backward"></i>',
|
||||
prev: '<i class="fa fa-step-backward"></i>',
|
||||
next: '<i class="fa fa-step-forward"></i>',
|
||||
last: '<i class="fa fa-fast-forward"></i>',
|
||||
href: '?page={{number}}'
|
||||
// prevText: '<span aria-hidden="true">«</span>',
|
||||
// nextText: '<span aria-hidden="true">»</span>',
|
||||
totalPages: pages,
|
||||
first: '<i class="fa fa-angle-double-left"></i>',
|
||||
prev: '<i class="fa fa-angle-left"></i>',
|
||||
next: '<i class="fa fa-angle-right"></i>',
|
||||
last: '<i class="fa fa-angle-double-right"></i>',
|
||||
href: true,
|
||||
pageVariable: 'page',
|
||||
});
|
||||
|
||||
function parseQueryString() {
|
||||
let str = window.location.search;
|
||||
const objURL = {};
|
||||
|
||||
str.replace(
|
||||
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
|
||||
function ($0, $1, $2, $3) {
|
||||
objURL[$1] = $3;
|
||||
}
|
||||
);
|
||||
return objURL;
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
?>
|
||||
<div class="col-sm-8 col-sm-pull-4">
|
||||
<div class="blog">
|
||||
<ul class="page-selection pagination-lg blog-pagination"></ul>
|
||||
<div id="content">
|
||||
<?php foreach($pageContent as $item) {
|
||||
$this->load->view('blog/postListEntry', $item);
|
||||
} ?>
|
||||
</div>
|
||||
<ul class="page-selection pagination-lg blog-pagination"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8 order-lg-first">
|
||||
<div class="blog">
|
||||
<ul class="pagination pagination-lg justify-content-center"></ul>
|
||||
<div id="content">
|
||||
<?php foreach ($pageContent as $item) {
|
||||
$this->load->view('blog/postListEntry', $item);
|
||||
} ?>
|
||||
</div>
|
||||
<ul class="pagination pagination-lg justify-content-center"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
Reference in New Issue
Block a user