HMENU: How to wrap page content into my menu?

I would like to build a full with dropdown menu based on page content defined into a folder.

The idea is to have:

MENU (folder) - menu 1 (page) - menu 2 (page)

My goal is to get the following output:

  • menu 1 content in menu 1 page
  • menu 2 content in menu 2 page

There is only one content bloc in the pages.

No problem to get the li with menu 1 / 2 but I cannotfind the way to get and wrap the page content.

My code looks like

menu.nav = HMENU
menu.nav {
  special = directory
  special.value = 214
  entryLevel = 1
  1 = TMENU
  1.wrap = <ul>|</ul>
  1.expAll = 1
  1.NO = 1
  1.NO.wrapItemAndSub.cObject = TEXT
  1.NO.wrapItemAndSub.cObject.value = <li>|</ul></li>
  1.NO.after.cObject = COA
  1.NO.after.cObject {
    10 = TEXT
    10.value = <div class="dropdown">

    20 = CONTENT
    20 {
      table = tt_content
      select {

.... 

but I cannot figure out what is required here to get the content of the pages.

Does someone can help me with this issue?

Thanks in advance. Regards Joël

I'll try a solution here, hoping that I'm not simplifying too much your code,at least you could take it as a starting point:

menu.nav = HMENU
menu.nav {
    special = directory
    special.value = 214    
    1 = TMENU
    1.wrap = <ul>|</ul>
    1.NO {

        wrapItemAndSub = <li>|</li>
        after.cObject = CONTENT
        after.cObject {
            table = tt_content
            select {
                pidInList.field = uid
                where =   {#colPos} = 0   
            }
            renderObj = < tt_content
            wrap = <div class="dropdown">|</div>  
        }
    }
} 

I took this one as starting point.

HMENU — TypoScript Template Reference master documentation, Apart from just creating a hierarchical menu of the pages as they are Stores the rendered content into the caching framework and reads it from there. page.10 = HMENU page.10 { entryLevel = 4 1 = TMENU 1.wrap = <ul> | </ul> 1.NO. Objects of type HMENU generate hierarchical menus. It is the one usually being used to create the navigation menu of websites. The cObject HMENU allows you to define the global settings of the menu as a whole. For the rendering of the single menu levels, different menu objects can be used.

I had a similar problem sometime ago, came upwith this code to make a menu containing database information.

It is not an answer, but it is a similar piece of code. Hopefully it gives you an idea.

It generates a list of links to pages which have "no_search" = 0 or another condition. There is also a database join made to get the pagepath or url of pages in the site.

Think you can do the same thing with your page content, output it as html.

lib.sitemap = CONTENT
lib.sitemap {
  table = pages
  select {
    orderBy = pages.sorting
    selectFields = pages.uid, pages.title, tx_realurl_pathcache.pagepath
    join = tx_realurl_pathcache ON tx_realurl_pathcache.page_id=pages.uid
    pidInList = 44
    recursive = 7
    where = (no_search="0") or (nav_hide=1 and no_search=0)
    groupBy = tx_realurl_pathcache.page_id
  }
  renderObj = COA
  renderObj.wrap = <li>|</li>
  renderObj.10 = TEXT
  renderObj.10 {
    field = pagepath
    wrap = <a href="|">
  }
  renderObj.20 = TEXT
  renderObj.20.field = title
  renderObj.30 = TEXT
  renderObj.30.value = </a>
}
lib.sitemap.wrap = <ul> | </ul>

TYPO3 typoscript example of 3-level menu with HMENU and TMENU, The typoscript for the main menu on the left side (content_menu section) is called "+ Content menu" and will be put on the root page. lib.content_menu = COA Loading data. Menu Introduction; Using and setting TypoScript. Entering and structuring TypoScript templates

You have to do this

lib.navbar2 = COA
lib.navbar2.wrap = <nav>|</nav>
lib.navbar2 {
20 = HMENU
20.wrap = <ul>|</ul>
20 {
    #entryLevel = 0
    #excludeUidList = 11,12
    1 = TMENU
    1 {
        wrap = |
        expAll = 1

        NO = 1
        NO.allWrap >
        NO.wrapItemAndSub = <li>|</li>
        NO.after.cObject = COA
        NO.after.cObject{
            stdWrap.wrap = <div class="megamenu-wrapper">|</div>
            20 = CONTENT
            20 {
                table = tt_content
                select {
                    pidInList.field = uid
                    orderBy = sorting
                    where = colPos=4 
                    languageField=sys_language_uid
                }
            }
            20.wrap = |
        }

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

        CUR = 1
        CUR < .NO
        CUR.wrapItemAndSub = <li class="active">|</li>
    }
}
}

Introduction to the Analysis Menu - CIAO 4.4, The format of the file used to define layout of the analysis menu matchs ds9's Analysis Menu <command name> - the name that appears in the menu entry. Long menus do not automatically wrap. (menu contents).. endhmenu start "Tools" menu hmenu Tools - alphabetical # tip Complete list of CIAO tools hmenu A-C� # render a menu in multi columns # wrap after 3 menu items # CSS styles needed: # ul { float:left; margin:0; } page = PAGE. page. 10 = HMENU. page. 10 { special = directory. special. value = 6 1 = TMENU 1 { wrap = < ul >|< /ul > NO = 1 NO { wrapItemAndSu

[PDF] Creating Flexible Menus, Menus built with TMENU output the title of each page in the menu as a text All of the wrap properties in TypoScript have the same format where | represents� Not a member of Pastebin yet? Sign Up, it unlocks many cool features!. raw download clone embed report print TypoScript 0.75 KB . tt_content. menu. 20. 1 = HMENU

b13/menus: TYPO3 Extension for creating fast menus in a , TYPO3 Extension for creating fast menus in a fast fashion - b13/menus. TYPO3 CMS is known for handling large websites with lots of content. TYPO3 Every menu is generated using HMENU, even the MenuDataProcessor for Fluid is using this. Yes, it's excludeLanguages = de,en page.10.wrap = <ul> | </ul> page.10. We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand

Posted in Typo3 Menu, Typo script for display sub menu of current page with header of parent menu. In 20 = HMENU 20 { entryLevel = 1 wrap = <ul>|</ul> 1 = TMENU 1 { target if you have set htmlSpecialChars in menu then you can add below line in your menu TS Configuration Content Element Wizard content parameter CSS css_filelinks � navigation to your site. Like other widgets, you simply drag the Menu widget onto your page to add menus. When do you so, you find that the menu labels, that are same as the page name, are automatically populated. When you change the page name in Plan View, the menu labels are automatically updated. You can add vertical as well as horizontal

Comments
  • Thanks a lot it works fine as weel. Implementation done, it's perfect.