Latest articles
Latest articles of category




Menu.tpl


menu.tpl is related with displaying the main navigation menu of the website. Usually it is displayed at the top of the page. Specifically the administrator selects the categories which will be published as menu links, through the global configuration menu ('menu settings' option).

<ul>
<li><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/index.php">Αρχική</a></li></ul>
{section name=menuCat loop=$category_name}
{if $category_name[menuCat] eq ''}
<ul><li><a href="#" rel="{$category_name[menuCat]}">{$category_name[menuCat]}</a></li></ul>
{elseif ($menu_cat_link[menuCat]|substr:0:4 eq 'www.')} <!--for external link-->
<ul><li><a href="http://{$menu_cat_link[menuCat]}" rel="{$category_name[menuCat]}">{$category_name[menuCat]}</a></li></ul>
{elseif ($menu_cat_link[menuCat]|substr:0:4 eq 'http')} <!--for external/internal link-->
<ul><li><a href="{$menu_cat_link[menuCat]}" rel="{$category_name[menuCat]}">{$category_name[menuCat]}</a></li></ul>
{elseif ($menu_cat_link[menuCat]|strstr:"/")} <!--for link from files-->
<ul><li><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$menu_cat_link[menuCat]}" rel="{$category_name[menuCat]}">{$category_name[menuCat]}</a></li></ul>
{else}
<ul><li><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$under_category_name[menuCat]|urlencode|urlencode}" rel="{$category_name[menuCat]}">{$category_name[menuCat]}</a></li></ul>
{/if}
{/section}

 

in addition, if there are subcategories which are needed to be displayed a drop down menu is displayed

{section name=menuCat loop=$category_name}
    {section name=dropMenu1 loop=$menu_category_name}
         {if $category_name[menuCat] eq $menu_category_name[dropMenu1]}

    <div id="{$category_name[menuCat]}" style="width: auto;">
      {section name=dropMenu1 loop=$menu_category_name}

       {if $category_name[menuCat] eq $menu_category_name[dropMenu1]}
               {if $menu_links[dropMenu1]|substr:0:4 eq 'www.' }
               <ul><li><a href="http://{$menu_links[dropMenu1]}">{$menu_subcategory_name[dropMenu1]}</a></li></ul>
               {elseif ($menu_links[dropMenu1]|substr:0:4 eq 'http')} <!--for link from files-->
                 <ul><li><a href="{$menu_links[dropMenu1]}">{$menu_subcategory_name[dropMenu1]}</a></li></ul>
               {elseif ($menu_links[dropMenu1]|strstr:"/")} <!--for link from files-->
                 <ul><li><a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$menu_links[dropMenu1]}">{$menu_subcategory_name[dropMenu1]}</a></li></ul>
               {else}
               <ul><li> <a href="{$smarty.const.WEBSITE_ROOT}/{$smarty.session.session_lang}/{$menu_under_category_name[dropMenu1]|urlencode|urlencode}/{$menu_under_subcategory_name[dropMenu1]|urlencode|urlencode}">{$menu_subcategory_name[dropMenu1]}</a></li></ul>
               {/if}
       {/if}
       {/section}</div>{/if}{/section}
{/section}
Posted on: 23/03/2011