You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
765 B
PHTML
26 lines
765 B
PHTML
8 years ago
|
<?php
|
||
|
|
||
|
$output_posts = '';
|
||
|
|
||
|
$posts = $pages->find("template=post,sort=-date");
|
||
|
|
||
|
foreach($posts as $post){
|
||
|
|
||
|
|
||
|
$template = new TemplateFile($config->paths->templates . "markup/post_small.inc");
|
||
|
$template->set('title', $post->title);
|
||
|
$template->set('date', $post->getUnformatted('date'));
|
||
|
$template->set('url', $post->httpUrl);
|
||
|
$template->set('image', (count($post->images) ? "<img class='responsive' src='{$post->images->first()->size(300,200)->url}'></img>" : ""));
|
||
|
$template->set('body', $post->get('summary|body'));
|
||
|
$template->set('id', $post->id);
|
||
|
|
||
|
$output_posts .= $template->render();
|
||
|
|
||
|
};
|
||
|
|
||
|
$template = new TemplateFile($config->paths->templates . "markup/list_blog.inc");
|
||
|
$template-> set('posts', $output_posts);
|
||
|
|
||
|
$content = $template->render();
|