Latest articles
Latest articles of category




Latest.tpl


latest.tpl is related with displaying a content at the homepage of the site (usually at the right or the left column) including the titles of articles which have been added lately. Specifically the administrator selects the number of articles that will be displayed, at the global configuration menu (Latest Articles option). The title of the article is linked to the article.tpl where the main body of these articles is displayed.

Latest articles will be displayed after you include the relevant file into your tpl, usually indexheader or indexfooter.
The code to insert this tpl is:

How to include latest.tpl
{include file="../templates/themes/$themeName/latest.tpl"}

if there are no articles a message is displayed on the main page:

No articles
{if $countLatest<1}
    <div><i>{t}There are no Latest Articles{/t}</i></div>

Otherwise if there are articles added recently with the option 'Show in the Home Page' unchecked:

Displays a list of latest articles
{else}
{section name=latest loop=$latest_id}
{if $latest_subcategory_name[latest] eq ''}
        <div><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$latest_category_name[latest]|urlencode|urlencode}/{$latest_wholeTitle[latest]|urlencode|urlencode}.html" class="white12">{$latest_title[latest]}....</a></div>
    {else}
        <div><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$latest_category_name[latest]|urlencode|urlencode}/{$latest_subcategory_name[latest]|urlencode|urlencode}/{$latest_wholeTitle[latest]|urlencode|urlencode}" class="white12">{$latest_title[latest]}....</a><br/>
    {/if}

({t}Posted on: {/t} {$latest_postedDate[latest]|date_format:"%d/%m/%Y"})</div>
{/section}
{/if}
</div>

This div is displayed after the title of the article and informs the user when the article has been submitted

({t}Posted on: {/t} {$latest_postedDate[latest]|date_format:"%d/%m/%Y"})</div>

 

Posted on: 23/03/2011