ProcessWire - Pagination: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „Seitenbrowser / Pagebrowser in ProcessWire https://processwire.com/api/modules/markup-pager-nav/ * Im Template erlauben Beispiele Kindseiten auflisten <syn…“)
 
Zeile 6: Zeile 6:
 
Beispiele
 
Beispiele
  
Kindseiten auflisten
+
Kindseiten (z.B. Blog Einträge) auflisten
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
$options = array(
+
// override some standard pager settings
'listMarkup' => "<ul class='uk-list uk-list-striped'>{out}</ul>",
+
$pagerOptions = array(
'pagerOptions' => array(
+
  'listMarkup' => "<ul class='uk-pagination'>{out}</ul>",
'listMarkup' => "<ul class='uk-pagination'>{out}</ul>",
+
);
)
+
$posts = page()->children('limit=10');
);
+
$pagination = $posts->renderPager($pagerOptions);
$content = $page->children("limit=10")->render($options);
+
// output pagination
 +
echo ($pagination)
 +
 
 
/*
 
/*
 
  * Note that the render() method above is from the MarkupPageArray plugin module.
 
  * Note that the render() method above is from the MarkupPageArray plugin module.

Version vom 13. September 2018, 21:08 Uhr

Seitenbrowser / Pagebrowser in ProcessWire

https://processwire.com/api/modules/markup-pager-nav/
  • Im Template erlauben

Beispiele

Kindseiten (z.B. Blog Einträge) auflisten

// override some standard pager settings
$pagerOptions = array(
  'listMarkup' => "<ul class='uk-pagination'>{out}</ul>",
);
$posts = page()->children('limit=10');
$pagination = $posts->renderPager($pagerOptions);
// output pagination
echo ($pagination)

/*
 * Note that the render() method above is from the MarkupPageArray plugin module.
 * It does nothing more than iterate through the provided pages and make an unordered list,
 * optionally with pagination.