如何在自定义菜单模板中显示选定页面?

时间:2014-06-03 08:47:44

标签: html dotnetnuke token ddrmenu

我正在使用DDR菜单令牌模板在DNN中创建自己的自定义菜单。

在我的菜单中,我想要选择我当前所在页面的菜单链接。我可以使用令牌[SELECTED]来实现此目的。但是,无论何时我处于第二层或第三层页面,都不会选择该链接。如何编写代码,以便即使我在子页面中也会选择父页面链接?

这是我的代码

[>NODE-TOP]
<li class="[?NODE]dropdown[/?][?SELECTED] current active[/?]">
    [?ENABLED]
        <a class="dropdown-toggle forcelink" data-toggle="dropdown" data-hover="dropdown" data-delay="300" href="[=URL]">[=TEXT]<span class="[?NODE]caret[/?]"></a>
    [/?]
    [?NODE]
        <ul class="dropdown-menu">
            [*>NODE]
        </ul>
    [/?]
</li>
[/>]
[>NODE]
<li class="dropdown-submenu">
    [?ENABLED]
            <a href="[=URL]">[=TEXT]<span class="[?NODE]caret-right[/?]"></a>
    [/?]
    [?NODE]
        <ul class="dropdown-menu">
            [*>NODE]
        </ul>
    [/?]
</li>
[/>]

以下是一些可用于DDRMenu的令牌:

NODE - A page
ID - The page ID
TEXT - The page name (i.e. what should normally be displayed in the menu)
TITLE - The full page title
URL - The page URL
ENABLED - Whether the page is enabled
SELECTED - Whether the page is selected
BREADCRUMB - Whether the page is in the current breadcrumb
SEPARATOR - Whether the node is a separator
ICON - The URL of the page icon
LARGEIMAGE - The URL of the large page icon (DNN 6 only)
FIRST - Whether the page is the first in its level
LAST - Whether the page is the last in its level
ONLY - Whether the page is the only one in its level
DEPTH - The depth of the current page in the menu structure (starting at 0)
TARGET - The target window for the url defined for the page (_new or null)
KEYWORDS - The keywords defined for the current page
DESCRIPTION - The description of the current page
TARGET - The target property is used to identify the browser window.

1 个答案:

答案 0 :(得分:1)

您的代码未在较低级别测试SELECTED。这是以[&gt; NODE]开头的部分。

请注意,还有一个BREADCRUMB对于痕迹路径中的所有页面都是如此。