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

using latest blog entry titles as a news feed

Feed 2 posts, 2 voices

Avatar
2 posts

Hi,

Im new to frog CMS (its quite nice, easiest CMS ive had the pleasure of skinning.

Im trying to display the titles of my latest blog entries in a menu/box on my website. Now i used the code that was already there for the blog after it was created. But i cant seem to get it to replicate the info where i want it.

I’ve put it in a snippet to include on certain pages, the code is as follows.
<?php $blog_pages = $this->find(’/blog/’)->children(); ?>

<?php foreach( $blog_pages->children(array(‘limit’ => 4, ‘offset’ => 1, ‘order’ => ‘page.created_on DESC’)) 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&#8230;’); ?> <p class=“info”>Posted by <?php echo $article->author(); ?> on <?php echo $article->date(); ?></p>
</div>
<?php endforeach; ?>

and the code for my blog page.

<?php $last_articles = $this->children(array(‘limit’=>5, ‘order’=>‘page.created_on DESC’)); ?>
<?php foreach ($last_articles as $article): ?>
<div class=“entry”> <h3><?php echo $article->link($article->title); ?></h3> <?php echo $article->content(); ?> <p class=“info”>Posted by <?php echo $article->author(); ?> on <?php echo $article->date(); ?> <br />tags: <?php echo join(’, ‘, $article->tags()); ?> </p>
</div>
<?php endforeach; ?>

sidebar

<?php $article = $this->find(’/blog/’); ?>
<?php $archives = $article->archive->archivesByMonth(); ?>

<h3>Archives By Month</h3>
<ul>
<?php foreach ($archives as $date): ?> <li><a href=”<?php echo BASE_URL . $this->url .’/’. $date . URL_SUFFIX; ?>”><?php echo strftime(’%B %Y’, strtotime(strtr($date, ‘/’, ‘-’))); ?></a></li>
<?php endforeach; ?>
</ul>

I read through the forums and found this topic, but i dont get it. it doesnt seem to want to work. http://forum.madebyfrog.com/forum/topic/425

If you need anymore info please ask.

Thanks,

Phil

 
Avatar
180 posts

First line

<?php $blog_pages = $this->find(’/blog/’)->children(); ?>

Replace to next one:

<?php $blog_pages = $this->find(’/blog/’); ?>
 
Avatar
2 posts

Hi jMas,

Thanks for your help. that worked a treat!! its working now and you’ve saved me a lot of banging head on desk.

Thank you very much.

Phil