Fortron wrote:I'm using Wolf 0.6.0b and I run into a problem with Advanced Find 1.0.6,
I can't get past 10 displayed items even tough I've set the limit to 20:
<ol>
<?php $articles = adv_find(array('nieuws/2010'), array('order' => 'page.published_on DESC', 'limit' => '20')); ?>
<?php foreach ($articles as $article): ?>
<?php echo '<li>' . $article->link() . ' ' . '<span>' . $article->date('%e %B %Y') .'</span></li>' . PHP_EOL; ?>
<?php endforeach; ?>
</ol>
Any solution that doesn't require a update to Wolf CMS 0.7.x?
Yeah, give me a few minutes to an hour. I know what the problem is.
EDIT: Ok, I thought I knew the problem, but apparently I did do it right. Are you sure you've got more than 10 articles in nieuws/2010? Advanced Find is working correctly on my site when I increase to 20. My homepage, for instance, works like this:
<?php
$slugs = adv_find(array('articles'),array('where' => 'title NOT LIKE "Plugins"'));
foreach ($slugs as $slug) {
$child[] = '/'.$slug->parent()->slug().'/'.$slug->slug().'/';
}
$articles = adv_find($child, array('order' => 'published_on DESC', 'limit' => '20'));
?>
<?php foreach ($articles as $article): ?>
<div class="entry">
<h3><?php echo $article->link(); ?></h3>
<?php echo $article->content(); ?>
<?php if ($article->hasContent('extended')) echo $article->link('Continue Reading…'); ?>
<p class="info">Posted by <?php echo $article->author(); ?> on <?php echo $article->date(); ?></p>
</div>
<?php endforeach; ?>
You can see that at the top it searches for all slugs under the articles heading and then sets up the adv_find call accordingly.
Last edited by mtylerb (2011-01-29 04:09)
Cheers,
Tyler