Latest articles
Latest articles of category




Search.tpl and Sitemap.tpl


search.tpl is related with displaying the title of the articles based on the search request of the user. Moreover, beneath the title is displayed the date the articles have been submitted in order to inform when each article has been submitted.

Search.tpl will be displayed after you include the relevant code into your tpl, usually indexHeader.tpl and header.tpl or indexFooter.tpl and footer.tpl
The code to insert the search form is:

<div class="search">
                      <form method="post" enctype="multipart/form-data">
                        <label>{t}Search{/t}</label>
                        <input type="text" name="search" value="{$search}" />
                        <input type="submit" class="go" name="search_submit" value=""/>
                        {if isset($smarty.post.search_submit)}
                        <META HTTP-EQUIV="refresh" content="0;URL={$smarty.const.WEBSITE_ROOT}/cms/common/search.php?search={$smarty.post.search}">
                        {/if}
                      </form>
                    </div>

if there are no reuslts:

No results
 
{if $paginate.total <1}
<p></p>
    {t}There are 0 results for your search{/t}!

 

Otherwise:

Displays a list of articles which have been searched from the user
 
{else}
    {section name=search_results loop=$results}
        {if $results[search_results].subcategory_id eq '0'}
            <tr><td><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$results[search_results].seo_category_name|urlencode|urlencode}/{$results[search_results].seo_title|urlencode|urlencode}.html">{$results[search_results].title}</td></tr>
            <tr><td><p>{t}Posted on{/t}: {$results[search_results].date|date_format:"%d/%m/%Y"}</p></td></tr>
        {else}
            <tr><td><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$results[search_results].seo_category_name|urlencode|urlencode}/{$results[search_results].seo_subcategory_name|urlencode|urlencode}/{$results[search_results].seo_title|urlencode|urlencode}">{$results[search_results].title}</td></tr>
            <tr><td><p>{t}Posted on{/t}: {$results[search_results].date|date_format:"%d/%m/%Y"}</p></td></tr><p></p>
        {/if}
    {/section}

This content includes pagination for easy navigation when there are too many articles to display

{paginate_prev} {paginate_middle format="page"} {paginate_next}
</p>

    {if $paginate.size gt 1}
        Items {$paginate.first} - {$paginate.last} of {$paginate.total} displayed.
    {else}
        Item {$paginate.first} of {$paginate.total} displayed.
    {/if}
Page 2

Posted on: 23/03/2011