2017-08-30 49 views
0

我期待用基礎5.5.0開發一個帶3級下拉菜單的菜單!包含頁面內容的菜單。我可以看到標題,但是當我更改頁面或標籤時,內容不會改變(鏈接是:| --- 1 --- | |和標題11,標題12,標題13 ...和鏈接1到鏈接8或更多)。它通過菜單的鏈接初始化爲激活頁面的內容。對於每個標題,我想顯示相關頁面的內容。我希望頁面不在菜單中顯示。typoscript包含頁面內容的菜單基礎

[ --- 1 --- (*)][--- 2 --- ][--- 3 --- ] 
| Title 11  | Title 12  | Title 13  | 
| Content 11 | Content 12 | Content 13 |  
|    |    |    | 
| link 1  | link 4  | link 6  | 
| link 2  | link 5  | link 7  |    
| link 3  |    | link 8  | 

(*)actived。

包含頁面內容的菜單: 我可以顯示「內容11」,但它在所有其他「內容」(內容11 =內容12 =內容13)中無處不在。而不是標題的相應內容。當我點擊另一個鏈接時,它就是這個取代另一個鏈接的鏈接,並且在'內容x'中無處不在。

菜單本身起作用。

lib.menuprincipal = COA 
lib.menuprincipal { 
    wrap (
     <div data-magellan-expedition="fixed" class="large-12 column" data-magellan> 
     <nav class="top-bar" data-topbar role="navigation"> 
     | 
     </nav> 
     </div> 
    ) 

    # NavBar Header 
    10 = TEXT 
    10 { 
     data = leveltitle:0 
     typolink { 
      parameter.data = parameters : allParams 
      ATagParams = class="TestAddParamClass" 
      title.data = leveltitle:0 
      #forceAbsoluteUrl = 1 
     } 

     wrap (
      <ul class="title-area"> 
       <li class="name"> 
       <div class="show-for-small left"> 
        <div id="poslogomin1" class="right"> 
         <h2>Titre site/h2> 
        </div> 
        </div> 
       </li> 
       <li class="toggle-topbar menu-icon">|</li> 
      </ul> 
     ) 
    } 

    # menu 
    20 = HMENU 
    20 { 
     #entryLevel = 0 
     wrap (
       <section class="top-bar-section"> 
        <ul class="left">        
         |  
        </ul> 
       </section> 
     ) 

     # Premier niveau 
     1 = TMENU 
     1 { 
      entryLevel = 0 
      #wrap = | 
      expAll = 1 
      maxItems = 5    

      NO = 1 
      NO {  
      doNotLinkIt = 1 
      stdWrap.cObject = COA 
      stdWrap.cObject{ 

       10 = TEXT 
       10.typolink.no_cache = 1 
       10.typolink.ATagBeforeWrap = 1 
       10.typolink.parameter.field = uid 

       10.cObject = COA 
       10.cObject{        
         10 = TEXT 
         10.wrap = <div class="tile tile|"> 
         10.field = layout 

         20 = TEXT 
         20.wrap = <div class="title"><h2 style='color:darkblue'>|</h2></div> 
         20.field = title 

         30 = TEXT     
         30.wrap = <div class = "subtitle"><h2 style='color:darkred'>|</h2></div> 
         30.field = subtitle  

         40 = CONTENT   
         40.wrap = <div class = "subtitle"><div>|</div></div>                
         40 { 
          table = tt_content 
          select { 
           where= colPos=0 
           uidInList.field = this 
          } 
         } 
         40.field < styles.content.get 

         50 = TEXT 
         50.value = </div> 
       }   
      }  
      }   

      NO.wrapItemAndSub = <li class="has-dropdown">|</li> 

      ACT = 1 
      ACT.wrapItemAndSub = <li class="has-dropdown">|</li> 

      IFSUB = 1 
      IFSUB.wrapItemAndSub = <li class="has-dropdown">|</li>   
     }//1 

     # Deuxième niveau 
     2 < .1  
     2 = TMENU 
     2 { 
      #entryLevel = 0 
      maxItems = 5 
      wrap (
       <ul class="dropdown"> 
        <li> 
        <div class="row mynav" id="nav-2"> 
         | 
        </div> 
        </li> 
       </ul> 
      ) 
      expAll = 1 

      NO = 1 

      NO.wrapItemAndSub = <div class="large-3 medium-6 column">|</div> 
      NO.stdWrap.wrap = <h2 style='color:darkgreen'>|</h2> 

      ACT < .NO 
      CUR < .NO 
      IFSUB < .NO 
      ACTIFSUB < .NO   
     }//2 

     # Troisième niveau 
     3 = TMENU 
     3 {  
      #entryLevel = 0 
      maxItems = 5 

      wrap = <p>|</p> 
     }//3    
    } 
} 

我是輸入法的初學者,你能幫助我嗎?謝謝 ! 此致敬禮。

+0

1.您使用哪種TYPO3版本? 2.你使用css_styled_content或fluid_styles_content嗎? – ntiedt

+0

Typo3 8.7.4和fluid_styles_content。 –

+0

在lib.menuprincipal.20.1.NO.stdWrap.cObject.10.cObject.44處,首先聲明你的內容對象,然後分配styles.content.get。 1.這是不necceassary因爲styles.content.get的默認TS是: styles.content.get = CONTENT styles.content.get { 表= tt_content 選擇{ ORDERBY =排序 其中= {# colPos} = 0 } } – ntiedt

回答

0

在lib.menuprincipal.20.1.NO.stdWrap.cObject.10.cObject.44處,您首先聲明您的內容對象,然後將style.content.get分配給該字段。

  1. 這不是necceassary因爲styles.content.get的默認TS是:

    styles.content.get = CONTENT 
    styles.content.get { 
        table = tt_content 
        select { 
         orderBy = sorting 
         where = {#colPos}=0 
        } 
    } 
    
  2. 看到新colPos定義的where子句。我認爲這可能是一個問題。

  3. 你需要

    40.renderObj = TEXT 
        40.renderObj.field = yourfield 
    

    更多信息,請參見TYPO3 Dokumentation Section CONTENT

0

你好,我有做,在40個點,並添加:

40 = CONTENT 
40 { 
    table = tt_content 
     select { 
     orderBy = sorting 
     pidInList.field = uid        
     where = {#colPos}=0 and deleted = 0 and hidden = 0 
     } 
    renderObj = COA 
    renderObj { 
    10 = TEXT 
    10.stdWrap.field = header 

    10.stdWrap.wrap = <div class = "subtitle"><div>|</div></div> 

    20 = TEXT 
    20.stdWrap.field = bodytext 

    20.stdWrap.wrap = <p>|</p> 
    } 
} 

現在,這是正確的。

問候函

相關問題