FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

How could i Summarise multiple blogs from child pages into one

Feed 5 posts, 3 voices

Avatar
108 posts

Can anybody tell me how to re-write this function to summarise all blog pages found in sub-sections of the site into one list? So my tree currently looks like

Page 1 Child Page 1 Child Blog 1
Page 2 Child Page 2 Child Blog 2

and id like to combine all the blogs where they are found to one summarised list…

<?php  $last_articles = $this->find($this->parent->slug.'/articles')->children(); ?>
<ul id="news">
<?php foreach ($last_articles as $article): ?>
  <li><?php echo $article->link($article->title()); ?></li>
<?php endforeach; ?>
</ul>
 
Avatar
108 posts

Anyone have any ideas?

 
Avatar
108 posts

I am still trying to find a way of accessing all the article pages in the entire site and put them into one list with a limit…

Any ideas?

 
Avatar
6 posts

I want to know how to do this too.

 
Avatar
17 posts

Eh, I’m not sure but I think you should be able to do something with, well … Okay, it might be sort of complex.

I believe children() only finds the immediate children, so you need to do some kind of recursive function, unless there is an all() function.

 
Avatar
108 posts

Here is my solution:

<h3>Latest Blog Entries</h3>
<?php list($parent) = split('/', $this->url); ?>
<?php  $last_articles = $this->find($parent.'/articles')->children(array('limit'=>5, 'order'=>'page.created_on DESC')); ?>
<ul id="news">
<?php foreach ($last_articles as $article): ?>
  <li><?php echo $article->link($article->title()); ?></li>
<?php endforeach; ?>
</ul>