Latest articles
Latest articles of category




staticArticles.tpl


staticArticles.tpl is related with displaying the articles at the homepage of the site. Specifically the administrator selects a number of articles which will be appeared through the global configuration menu ('Static Articles' option). Then a short description of these articles is displayed and a read more link is directing to the article.tpl where the main body of these articles is displayed.

StaticArticles will be displayed after you include the relevant file into your tpl, usually indexHeader.tpl or indexFooter.tpl
The code to insert this tpl is:

How to include staticArticles.tpl
{include file="../templates/themes/$themeName/staticArticles.tpl"}
if there are no articles a message is displayed on the main page:
No articles
 
{if $count < 1}

<p>{t}There are no Articles!{/t}</p>

In the case that you have selected at the Global Configuration menu (Static Articles option) the option display 'Vertically" the following occurs:

display articles vertically
 
{else}
    <!-- display articles vertically -->
    {if $confValueDisplay eq 1}

        {section name=article loop=$title}
            {if $hide_titleS[article] eq '0'}
            <div class="article_content">
            <div class="article_title">{$title[article]}</div>
            {if ($admin==1) or ($userlevel_name eq 'Super Authors') or ($username eq $published_by)}
            <div class="link_edit"><a href = "{$smarty.const.WEBSITE_ROOT}/cms/articles/authorsArticle.php?action=edit&id={$article_id[article]}&category_name={$category_nameSta[article]}" rel="gb_page_fs[]" >{t}Edit article{/t}</a></div>
            {/if}</h5>

            {/if}
            <div class="articles_txt"><div class="images_staticArticles">
            {$descriptionSta[article]|truncate:450:"...":true}</div></div>


            {if $hide_maintextS[article] eq '0'}

                {if $subnameSta[article] eq ''}
                <a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$category_nameSta[article]|urlencode|urlencode}-{$seo_title[article]|urlencode|urlencode}.html" class="white10">
                {else}
                <a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$category_nameSta[article]|urlencode|urlencode}/{$subnameSta[article]|urlencode|urlencode}/{$seo_title[article]|urlencode|urlencode}" class="white10">
                {/if}
                <div class="read_more">{t}Read more{/t}</div></a>
                {/if}
             <br />
             </div>
        {/section}


In the case that you have selected at the Global Configuration menu (Static Articles option) the option display 'Horizontally" the following occurs:

display articles horizontal
 
{else}
        {section name=article loop=$title}
        <div class="horizontal_articles">
        <div class="article_content">
        <div class="article_title">{$title[article]}</div>
        {if $hide_title[article] eq '0'}
            {if ($admin==1) or ($userlevel_name eq 'Super Authors') or ($username eq $published_by)}
            <a href = "{$smarty.const.WEBSITE_ROOT}/cms/articles/authorsArticle.php?action=edit&id={$article_id[article]}&category_name={$category_nameSta[article]}" rel="gb_page_fs[]"> {t}Edit article{/t}
            {/if}
        </h5>
        {/if}
        <div class="articles_txt"><div class="images.staticArticles">{$descriptionSta[article]|truncate:650:"...":true}</div></div>
  <!--      {$all_descriptionSta[article]|truncate:4000:"...":true}-->
          {if $hide_maintextS[article] eq '0'}

                {if $subnameSta[article] eq ''}
                <a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$category_nameSta[article]|urlencode|urlencode}-{$seo_title[article]|urlencode|urlencode}.html" class="white10">
                {else}
                <a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$category_nameSta[article]|urlencode|urlencode}/{$subnameSta[article]|urlencode|urlencode}/{$seo_title[article]|urlencode|urlencode}" class="white10">
                {/if}
                <div class="read_more">{t}Read more{/t}</div></a>
                {/if}
            </div>

        </div> <div class="clear"></div>

        {if $hide_maintextS[article] eq '0'}

            {if $subnameSta[article] eq ''}
            <a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$category_nameSta[article]|urlencode|urlencode}-{$seo_title[article]|urlencode|urlencode}.html"></a>
            {else}

            <a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$category_nameSta[article]|urlencode|urlencode}/{$subnameSta[article]|urlencode|urlencode}/{$seo_title[article]|urlencode|urlencode}"></a>
            {/if}


        {/if}
        {counter skip=1 assign=theCounter name=theCounter}
        {if $theCounter eq 2}
        <table><tr><td>
        {/if}
        {/section}
        </td></tr>
        </table>


    {/if}
{/if}

Tips:

    * Only in the case that the user is logged in as administrator or Super Author ,she/he has the right to edit the article using a ajax pop-up window which is displayed
 
      {if ($admin==1) or ($userlevel_name eq 'Super Authors') or ($username eq $published_by)}
                      <div class="link_edit"><a href = "{$smarty.const.WEBSITE_ROOT}/cms/articles/authorsArticle.php?action=edit&id={$article_id[article]}&category_name={$category_nameSta[article]}" rel="gb_page_fs[]" >{t}Edit article{/t}</a></div>
    * With this line the description of the article is limited to 450 characters long despite it's length and the main body is displayed when the read more link has been clicked.
 

      {$descriptionSta[article]|truncate:450:"...":true}
Posted on: 23/03/2011