Как отобразить выбранную страницу в пользовательском шаблоне меню?

StackOverflow https://stackoverflow.com//questions/24010805

Вопрос

Я создаю свое собственное настраиваемое меню в DNN, используя шаблон токена меню DDR.

В моем меню я хотел бы ссылку меню страницы, которую я в данный момент, чтобы выбрать.Я могу добиться этого, используя токен GeneracodicCode.Однако всякий раз, когда я нахожусь в страницах 2-го уровня или 3-го уровня, ссылка не выбрана.Как я могу написать код так, чтобы ссылка на родительскую страницу будет выбрана, даже когда я нахожусь в детских страницах?

Это мой код

[>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.
.

Это было полезно?

Решение

Ваш код не тестирует для выбранного на более низких уровнях.Это в разделе, который начинается с [> узла].

Обратите внимание, что также существует панирум, который будет правдой для всех страниц в Trail Charmumb.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top