Edit #2
I have a good clue on my second post.
------------------
Simple call on my template:
<div id="listDocs" class="columns">
<div id="Publications" class="column">
<h2>Publications</h2>
[[!liste? &type=`Publications`]]
</div>
<div id="Journaux" class="column">
<h2>Journaux</h2>
[[!liste? &type=`Journaux`]]
</div>
<div id="Bulletins" class="column">
<h2>Bulletins</h2>
[[!liste? &type=`Bulletins`]]
</div>
</div>
This is the
liste snippet:
$page = '1';
if ( $type == '' ) {
$where = '';
} else {
switch($type) {
case "Publications":
$icon = 'book';
if(isset($_GET['page']) && $_GET['type'] == "Publications") {
$page = $_GET['page'];
}
break;
case "Journaux":
$icon = 'newspaper-o';
if(isset($_GET['page']) && $_GET['type'] == "Journaux") {
$page = $_GET['page'];
}
break;
case "Bulletins":
$icon = 'file-text-o';
if(isset($_GET['page']) && $_GET['type'] == "Bulletins") {
$page = $_GET['page'];
}
break;
default:
break;
}
$where = '{"type":"'.$icon.'"}';
}
$output = '<div class="liste">';
$output .= $modx->runSnippet('getPage',array(
'element' => 'getImageList',
'tpl' => 'listDoc',
'limit' => '2',
'page' => $page,
'where' => $where,
'tvname' => 'listDoc',
'sort' => '[{"sortby":"date","sortdir":"DESC"}]',
'pageNavOuterTpl' => '[[+first]][[+prev]]<ul class="pagination-list">[[+pages]]</ul>[[+next]][[+last]]',
'pageNavTpl' => '<li[[+classes]]><a class="pagination-link"[[+title]] href="[[~[[+docid]]]]?page=[[+pageNo]]&type='.$type.'">[[+pageNo]]</a></li>',
'pageActiveTpl' => '<li[[+classes]]><a class="pagination-link is-active"[[+title]] href="[[~[[+docid]]]]?page=[[+pageNo]]&type='.$type.'">[[+pageNo]]</a></li>',
'pageFirstTpl' => '<a class="pagination-previous"[[+title]] href="[[~[[+docid]]]]"><i class="fa fa-fast-backward" aria-hidden="true"></i></a>',
'pageLastTpl' => '<a class="pagination-next"[[+title]] href="[[~[[+docid]]]]?page=[[+total]]&type='.$type.'"><i class="fa fa-fast-forward" aria-hidden="true"></i></a>',
'pageNextTpl' => '<!--<a class="pagination-next"[[+title]] href="[[+href]]&type='.$type.'"><i class="fa fa-forward" aria-hidden="true"></i></a>-->',
'pagePrevTpl' => '<!--<a class="pagination-previous"[[+title]] href="[[+href]]&type='.$type.'"><i class="fa fa-backward" aria-hidden="true"></i></a>-->'
));
$output .= '</div><nav class="pagination is-centered">[[!+page.nav]]</nav>';
return $output;
The result:
1st column display the list of documents with the type "Publications".
2nd column display the list of documents with the type "Journaux".
3st column display the list of documents with the type "Bulletins".
Everything is OK… except the pagination. This is the issue on Friday:
Pagination on the 1st column: number of page is calculate with the "Publications" documents type and
$type display "Publications". OK.
Pagination on the 2nd column: number of page is calculate with the "Journaux" documents type and
$type display "Journaux". OK.
Pagination on the 3st column: number of page is calculate with the "Journaux" documents type and
$type display "Journaux". What?
And the issue today:
Pagination on the 1st column: number of page is calculate with the "Publications" documents type and
$type display "Publications". OK.
Pagination on the 2nd and the 3st column: number of page is calculate with the "Publications" documents type and
$type display "Publications". What?
And if change the HTML page:
<div id="listDocs" class="columns">
<div id="Publications" class="column">
<h2>Bulletins</h2>
[[!liste? &type=`Bulletins`]]
</div>
<div id="Journaux" class="column">
<h2>Journaux</h2>
[[!liste? &type=`Journaux`]]
</div>
<div id="Bulletins" class="column">
<h2>Publications</h2>
[[!liste? &type=`Publications`]]
</div>
</div>
The result:
1st column display the list of documents with the type "Bulletins".
2nd column display the list of documents with the type "Journaux".
3st column display the list of documents with the type "Publications".
Display is OK. But, the pagination:
Pagination on the three columns: number of page is calculate with the "Publications" documents type and
$type display "Publications". WHAT?
Please HELP!
NB If I call getImageList the issue is exactly the same.
------------------
Edit #1
If I change the line before
return $output; to this:
$output .= '</div><nav class="pagination is-centered">'.$type.'[[!+page.nav]]'.$type.'</nav>';
The result is OK: All
$type display the good doc type of each column. So, why pagination keep the result of "Publications" doc type even if "Publications" is put on the last column?
[ed. note: neoziox last edited this post 6 years, 10 months ago.]