News lister?

Feed 8 posts, 2 voices

Avatar
25 posts

Is there a way to list articles and add a "read more" link that links the reader to the rest of the article?

It would be handy.

 
Avatar
541 posts

<?php $last_articles = $this->children(array('limit'=>10, 'order'=>'created_on desc')); ?> <?php foreach ($last_articles as $article): ?>

<?php $article->link($article->title); ?>

<?php $article->content(); ?>
<?php $article->link('read more'); ?>

<?php endforeach; ?>
 
Avatar
541 posts
<?php $last_articles = $this->children(array('limit'=>10, 'order'=>'created_on desc')); ?>
<?php foreach ($last_articles as $article): ?>
<div class="article">
 <h2 class="article-title"><?php $article->link($article->title); ?></h2>
 <p class="article-content"><?php $article->content(); ?><br /><?php $article->link('read more'); ?></p>
</div>
<?php endforeach; ?>
 
Avatar
541 posts

this is really crappy for printing code I will have to check this ;)

 
Avatar
541 posts

this code have to be place in the articles page

 
Avatar
25 posts

Thanks. One more thing.

How can make a short story? So they read the short story then they click "read more" to view the rest of the article. Right now it shows the entire article on the article page.

 
Avatar
541 posts

add a new part (tab) after the body (the little green +), call it 'short' then instead of including the $this->content() include $this->content('short')

 
Avatar
25 posts

When I click read more, it dosn't show the title. What do I add to show the content title?

 
Avatar
541 posts

in the layout you have to write <?php echo $this->title() ?> or just `<?php $this->title() ?> if you use Frog CMS 0.2.2