如何在 typo3 8 LTS 中从主域隐藏子域树的子页面

How to hide sub page of sub-domain tree from the main domain in typo3 8 LTS

我在下面有网站页面树:

   - Main domain 1 (main domain)
     - Home
     - about us
     - Contact
     - gallery
     - Sub domain 2 (sub-domain)
         - Home
         - about us
         - contact
         - gallery

现在,当主域处于活动状态时,它也会显示子域内页。我只需要域名(子域 2)。当单击 link 时,它将切换并重定向到子域

这是 HMENU 打字错误:

lib.nav = HMENU
lib.nav.wrap = <nav id="primary-menu">|</nav>
lib.nav{
    special = directory
    special.value = 6
    # excludeUidList = 6

    1 = TMENU
    1 {
        wrap = <ul>|</ul>
        expAll = 1

        NO = 1
        NO {
            10 = TEXT
            10.data = field:title // field:nav_title
            10.wrap = |

            wrapItemAndSub = <li>|</li>
            wrapItemAndSub.override.cObject = COA
            wrapItemAndSub.override.cObject {
                if {
                    value = 4
                    equals.field = doktype
                    isTrue = 1
                    isTrue.if {
                        value.data = TSFE:page|uid
                        equals.field = shortcut
                    }
                }
                10 = TEXT
                10.value = <li class="current">|</li>
            }

        }

        ACT = 1
        ACT.ATagBeforeWrap = 1
        ACT < .NO
        ACT.wrapItemAndSub = <li class="current">|</li>

        IFSUB = 1
        IFSUB < .NO
        IFSUB.wrapItemAndSub = <li class="sub-menu" >|</li>
    }

    2 <.1
    2{
        wrap = <ul style="display: none;">|</ul>
        NO = 1
        NO {
            10 = TEXT
            10.data = field:title // field:nav_title
            10.wrap = |

            wrapItemAndSub = <li>|</li>
            wrapItemAndSub.override.cObject = COA
            wrapItemAndSub.override.cObject {
                if {
                    value = 4
                    equals.field = doktype
                    isTrue = 1
                    isTrue.if {
                        value.data = TSFE:page|uid
                        equals.field = shortcut
                    }
                }
                10 = TEXT
                10.value = <li class="current">|</li>
            }

        }

        ACT = 1
        ACT.ATagBeforeWrap = 1
        ACT < .NO
        ACT.wrapItemAndSub = <li class="current">|</li>

        IFSUB = 1
        IFSUB < .NO
        IFSUB.wrapItemAndSub = <li class="sub-menu" >|</li>        
    }
}

此处重定向 link 可以正常工作,但是当我浏览主域站点时,它还会显示子域的子页面。谁能帮我解决一下?

您可以像下面那样使用excludeUidList

excludeUidList = 21,22  // Sub-page Uid with comma seprated like this

例如。

lib.nav = HMENU
lib.nav.wrap = <nav id="primary-menu">|</nav>
lib.nav{
    excludeUidList = 21,22
    special = directory
    special.value = 6
    ....
    .....