Open /includes/display/ and find: RecentArticlesPanel.php and make a copy and name it something, for this example I'll call it RecentArticlesListPanel.php
Then do the same for the .html file located in /templates/{your-template}/Panels/RecentArticlesPanel.html
Open the .php file for editing and find:
AL_RECENTARTICLES_PANEL
It will be in there twice, once in quotes, the other not. Change them to something new for this file, e.g.:
AL_RECENTARTICLESLIST_PANEL
Now find:
$output = AL_HELPER::GetArticles($articleResult);
and add this line above like:
$GLOBALS['SnippetName'] = 'ArticleRecentList'; $output = AL_HELPER::GetArticles($articleResult);
Now open: /admin/includes/classes/class.helper.php then find:
$thisArticleRow = $GLOBALS["AL_CLASS_TEMPLATE"]->GetSnippet("ArticleList");and change it to:
if(isset($GLOBALS['SnippetName'])){
$thisArticleRow = $GLOBALS["AL_CLASS_TEMPLATE"]->GetSnippet($GLOBALS['SnippetName']);
}else{
$thisArticleRow = $GLOBALS["AL_CLASS_TEMPLATE"]->GetSnippet("ArticleList");
}Above we put in this code: $GLOBALS['SnippetName'] = 'ArticleRecentList';
This now means it will use the formatting in this file:
/templates/{your-template}/Panels/Snippets/ArticleRecentList.html
to display each article. You can use these placeholders in there:
%%GLOBAL_text%%
%%GLOBAL_authorurl%%
%%GLOBAL_author%%
%%GLOBAL_publishDate%%
%%GLOBAL_categories%
%%GLOBAL_authorpic%%
%%GLOBAL_content%%
%%GLOBAL_url%%
So if you put in:
<a href="%%GLOBAL_url%%">%%GLOBAL_text%%</a><br/>
It will use that for each article that is to be shown from the database.
You can change the number of articles to show by editing the first file again and finding:
$this->numArticles = $GLOBALS["AL_CFG"]["NumRecentArticles"];
and changing it to something like this:
$this->numArticles = 5;
Then you can include it into your template files using:
%%Panel.RecentArticlesListPanel%%
