2

我想点击文本“English”来获取网站的英文版本。在我有一个图形菜单之前:

lib.tslangmenu = HMENU
lib.tslangmenu {
  special = language
  special.value = 0,1,2
  addQueryString = 1
  1 = GMENU
  1.NO {
    XY = 24,16
    5 = IMAGE
    5.file = fileadmin/templates/images/deutsch.jpg || fileadmin/templates/images/englisch.jpg || fileadmin/templates/images/kroatisch.jpg
  }

  1.ACT < 1.NO
  1.ACT = 1
  1.ACT.wrap = <span class="langhide"> | </span>

  1.CUR < 1.ACT
  1.CUR = 1
}

到目前为止,这很有效。现在我应该将菜单更改为基于文本的菜单。

lib.tslangmenu {
  special = language
  special.value = 0,1,2
  special.normalWhenNoLanguage = 0
  addQueryString = 1
  1 = TMENU
  1.NO = 1
  1.NO.stdWrap.override = Deutsch || English || Hrvatski

  1.ACT < 1.NO
  1.ACT = 1
  1.ACT.stdWrap = <span class="langhide"> | </span>

  1.CUR < 1.ACT
  1.CUR = 1
}

span现在完全忽略了包装。现在菜单也显示如下:

MyCurrentPageName 英语 Hrvatski

如果我使用德语,则该单词deutsch将被当前页面标题覆盖。这同样适用于所有其他语言。我还尝试了这篇博客文章中给出的 TS 。但目前它也是如此。我如何让这个工作?

4

2 回答 2

3

第一个错误在您的 wrap: NOis not Wrapped 中,因此没有生成跨度(对于 NO-items)。显示页面标题的问题来自错误的复制。线

1.ACT < 1.NO

真的应该

1.ACT < .1.NO

以防万一,这是我正在积极使用的 TS-config:

lib.languageMenu = HMENU
lib.languageMenu {
  special = language
  special.value = 0,1

  1 = TMENU
  1 {
    wrap = <ul class="langMenu">|</ul>
    noBlur = 1
    NO = 1
    NO {
      linkWrap = <li class="menu-item normal">|</li>

      stdWrap.override = English || Deutsch
      stdWrap.htmlSpecialChars = 1
    }

    ACT < .NO
    ACT {
      doNotLinkIt = 1
      linkWrap = <li class="menu-item active">|</li>
    }

    # NO + Translation doesn't exist
    USERDEF1 < .NO
    USERDEF1.doNotLinkIt = 1

    # ACT + Translation doesn't exist
    USERDEF2 < .ACT
    USERDEF2.doNotLinkIt = 1
  }
}

问候,
约斯特

于 2012-12-17T16:45:37.790 回答
1

用标志图标检查这里

lib.languageMenu = HMENU
lib.languageMenu{

     special = language
     special.value = 0,1
     protectLvar = 1
     special.normalWhenNoLanguage = 0
    # wrap = <div class="language"><ul>|</ul></div>
     1 = TMENU
     1 {
       NO = 1
       NO {


        # linkWrap = <li class="in-active">|</li> || <li class="in-active">|</li>
         stdWrap.override = {$germanLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/german.png">|| {$englishLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/english.png">
         doNotLinkIt = 1
         stdWrap.typolink.parameter.data = page:uid
         stdWrap.typolink.additionalParams = &L=0 || &L=1
         stdWrap.typolink.addQueryString = 1
         stdWrap.typolink.ATagParams =class="InActive"
         stdWrap.typolink.addQueryString.exclude = id,cHash,no_cache
         stdWrap.typolink.addQueryString.method = GET
         stdWrap.typolink.useCacheHash = 0
         stdWrap.typolink.no_cache = 0
         stdWrap.htmlSpecialChars = 0

#         normalWhenNoLanguage = 0
       }
       ACT = 1
       ACT < .NO
       ACT.stdWrap.typolink.ATagParams =class="Active"
       ACT.stdWrap.htmlSpecialChars = 0



     #  USERDEF1 < .NO
     #  USERDEF1.doNotLinkIt = 0
    }
}
于 2018-04-12T10:39:45.083 回答