0

I am trying to show category description in category menu. Under each category link i would like to display a short description that is added through admin when creating the category. This is the code in the tpl that displays the category menu:

{hook name="blocks:sidebox_dropdown"}{strip}
{assign var="foreach_name" value="item_`$iid`"}

{foreach from=$items item="item" name=$foreach_name}

{hook name="blocks:sidebox_dropdown_element"}

<li class="{if $separated && !$smarty.foreach.$foreach_name.last}b-border {/if}{if $item.$childs}dir{/if}{if $item.active || $item|fn_check_is_active_menu_item:$block.type} cm-active{/if}">
    {if $item.$childs}

        {hook name="blocks:sidebox_dropdown_childs"}

        <div class="hide-border">&nbsp;</div>
        <ul>
            {include file="blocks/sidebox_dropdown_chiled.tpl" items=$item.$childs separated=true submenu=true iid=$item.$item_id}
        </ul>

        {/hook}

    {/if}
    {assign var="item_url" value=$item|fn_form_dropdown_object_link:$block.type}

    <a{if $item_url} href="{$item_url}"{/if} {if $item.new_window}target="_blank"{/if} class="my_main_navlinks">{$item.$name}</a>
</li>

{/hook}

{/foreach}
{/strip}{/hook}
4

1 回答 1

0

更改 sidebox_dropdown.tpl 文件不是正确的方法,因为该文件无处不在。

正确的方法是为类别创建一个新的块模板。打开这个文件夹:/design/themes/[YOUR_SKIN]/templates/blocks/categories/

你会发现(基本上)4个文件:

  • categories_dropdown_horizo​​ntal.tpl
  • categories_dropdown_vertical.tpl
  • categories_multicolumn_list.tpl
  • categories_text_links.tpl

创建一个新的并添加您需要的任何代码。将 sidebox_dropdown.tpl 代码也放入新文件中。

之后只需打开管理区域 -> 设计 -> 布局。打开类别块的属性并选择您的新文件。

于 2014-03-20T05:11:37.183 回答