2 posts
|
This is my first time using the frog,In the article page, the article only shows five the number of articles, how to set up other articles can be displayed,or use the next page.
On the home page, how to make the articles only appears as part of the contents, do not show all?
The article is too long there next page functionality?
Who can save me…… |
2 posts
|
I konw how to change the articles number
$this->children(array(‘limit’=>5, ‘order’=>‘page.created_on DESC’)); ?>
if I have 100 articles,how do it? |
180 posts
|
You need use Pagination plugin. Search forum http://forum.madebyfrog.com/topic/214 |
2 posts
|
Thank you,I will try it. |
58 posts
|
Just copy and paste this code on your page where you want to seeing pagination:
<h2><?php echo $this->title();?></h2>
<?php
$page = 0;
if (!empty($_SERVER['REQUEST_URI'])){
$parts = explode('/', $_SERVER['REQUEST_URI']);
if (!empty($parts[3]) && is_numeric($parts[3]) && $parts[3] >= 0)
$page = $parts[3];
}
use_helper('Pagination');
/* read about helper options in it source file on /frog/helpers/pagination.php */
$pagination = new Pagination(array(
'base_url' => '/news/page',
'total_rows' => $this->childrenCount(),
'per_page' => 5,
'num_links' => 3,
'cur_page' => ($page ? $page : 1)
));
if ($pagination->total_rows < ($pagination->cur_page - 1)*($pagination->per_page)): ?>
<h3>Page not found</h3>
<p>We still have not written so much news :) You can wait, because soon it will happen.</p>
<a href="/news/">on news page</a>
<?php endif; ?>
<?php foreach($this->find('news')->children(array('limit' => ($pagination->per_page), 'offset' => ($pagination->cur_page - 1)*($pagination->per_page), 'order' => 'page.created_on DESC')) as $j => $news): ?>
<div>
<h3><?php echo $news->link(); ?></h3>
<p><?php echo $news->content(); ?></p>
<span><?php if($news->hasContent('extended') && $news->content('extended') != '') { echo $news->link('read more»').' | '; } ?> Comments - <?php echo comments_count($news).' | Date: '.$news->date("%d.%m.%Y"); ?></span>
</div>
<?php endforeach;
if ($pagination->total_rows > ($pagination->cur_page - 1)*$pagination->per_page)
echo '<p><br />Pages: '.$pagination->createLinks().'</p>';
?>
|