Hi,
I am using a snippet for pagination starting with the following lines
<?php
$list = $page->children()->paginate(**6**);
$pagination = $list->pagination();
?>
Is there a simple way to change the number of page (here 6) depending on which template or which page the snippet is called ?
Thank you
texnixe
2
You can use a variable, which you can then pass to your snippet:
<?php
$list = $page->children()->paginate($i);
$pagination = $list->pagination();
?>
Then in your template:
<?php snippet('my-pagination-snippet', array('i' => 6)) ?>
You can pass variables to snippets like that:
<?php snippet('mysnippet', array('title' => 'Hello!')) ?>
EDIT: Too late
Thanks a lot
and sorry for newbie question
texnixe
5
We are here to answer your questions . And weren’t we all newbies at one time or the other …