Bug #36494

GMENU img has "name" attribute instead of "id" in html5

Added by Sven Tappert over 9 years ago. Updated about 4 years ago.

Should have
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


In tslib_menu::start() (class.tslib_menu.php, line 148-158) $this->nameAttribute is not correctly set to "id" for xhtmlDoctype "html5", because at this point "$GLOBALS['TSFE']->xhtmlDoctype" is an empty string.

As a result GMENUs get an obsolete "name" attribute in the img tags.

The error is caused by resetting "$GLOBALS['TSFE']->xhtmlDoctype" in class.tslib_pagegen.php (line 186), since "html5" is not considered as XHTML doctype.

Possible solutions:
  • html5 has to be added as xhtml doctype in class.tslib_pagegen.php
  • the switch statement in tslib_menu::start() should check for $GLOBALS['TSFE']->config['config']['doctype'] in line 148

Version 4.5 is probably affected as well.

Related issues

Related to TYPO3 Core - Bug #62622: Javascript variable version not setClosed2014-11-02

Related to TYPO3 Core - Bug #75983: GMENU rollover not workingClosed2016-04-29


Updated by Marcel Zweifel over 9 years ago

I have the same error with GMENU & HTML5. Try this as short hack:

config.xhtmlDoctype = xhtml_2


Updated by Stefan Krude about 7 years ago

This is still not working in 6.2.6.
Is nobody able or willing to fix that?


Updated by Riccardo De Contardi over 6 years ago

  • Is Regression set to No

The bug is still present on 6.2.14 and 7. I used the following code to test:

page.14.1 = GMENU
  wrap =<ul class="menu-ul">|</ul>
  NO = 1
    NO {
      wrap =<li class="menu-li">|</li>
      format = gif
      10 = TEXT
      10 {
        text.field = title
        fontSize = 14
        fontColor = #414141
        offset = 0,18
        niceText = 1
        antiAlias= 0
       imgParams = title="{field:title}" 
       allStdWrap.insertData = 1
       ATagParams = class="gmenu-no" 
    ACT = 1
    ACT < .NO
    ACT {
     10.fontColor = #d62919
    RO = 1
    RO < .NO

1) in both enviroments, the rollover does not work, a javascript error is thrown

Uncaught Reference
Error: version is not defined(anonymous function) @ (index):51

2) it works also with config.doctype=xhtml_strict , config.doctype=xhtml_11


Updated by Riccardo De Contardi about 6 years ago

I report here the description of #62622 (closed as duplicate) to help the discussion:

In typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php in function INTincScript_loadJSCode() there is JavaScript code emitted which tests the variable 'version'. This variable was set in sysext/cms/tslib/class.tslib_pagegen.php (version 4.5) but isn't set any more in typo3/sysext/frontend/Classes/Page/PageGenerator.php (version 6.2).
Because of this the hover effect in GMENU is not working.
Either the missing code should be readded again or the code in TypoScriptFrontendController.php should be adapted.


Updated by Riccardo De Contardi almost 6 years ago

  • Target version set to Candidate for Major Version

Updated by Riccardo De Contardi over 5 years ago

  • Assignee set to Benni Mack

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from New to Closed
  • Assignee deleted (Benni Mack)

This has been solved with https://review.typo3.org/#/c/47975/ so I think I can close it.

If you think this is the wrong decision, then let us know (on Slack for example - https://typo3.slack.com/ ) or open a new ticket and add a relation to this ticket number. Thank you


Updated by Oliver Hader about 4 years ago

  • Category changed from 1050 to Frontend

Also available in: Atom PDF