<img src="[[+tv.mainImage:default=`images/news-blank.gif`:phpthumbof=`w=32&h=32&zc=1`]]" alt="[[+pagetitle]]" class="entry-image">
[[+tv.articlePreview:notempty=`<img src="[[+tv.articlePreview]]" class="img-right" alt="[[+pagetitle]]" />`]]
[[+tv.articlePreview:notempty=`<img src="[[+tv.articlePreview]]" class="img-responsive" alt="[[+pagetitle]]" />`]]
/**
* Get the call for the latest posts
*
* @param string $placeholderPrefix
* @return string
*/
public function getLatestPostsCall($placeholderPrefix = '') {
$settings = $this->getContainerSettings();
$output = '[[getResources?
&parents=`'.$this->get('id').'`
&hideContainers=`1`
&showHidden=`1`
&tpl=`'.$this->xpdo->getOption('latestPostsTpl',$settings,'sample.ArticlesLatestPostTpl').'`
&limit=`'.$this->xpdo->getOption('latestPostsLimit',$settings,5).'`
&offset=`'.$this->xpdo->getOption('latestPostsOffset',$settings,0).'`
&sortby=`publishedon`
&where=`{"class_key":"Article"}`
]]';
$this->xpdo->setPlaceholder($placeholderPrefix.'latest_posts',$output);
return $output;
}
[[+{prefix}latest_posts]][[getResources?
&parents=`[[*id]]`
&hideContainers=`1`
&showHidden=`1`
&tpl=`sample.ArticlesLatestPostTpl`
&limit=`5`
&offset=`0`
&sortby=`publishedon`
&where=`{"class_key":"Article"}`
&includeTVs=`1`
&processTVs=`1`
]]