Bug #40647
closed
Typo3 creates menu without href attribut inside the a tag
Added by Ralle Büchnitz about 12 years ago.
Updated almost 9 years ago.
Description
Pages that are created as shortcuts (first subpage) fail to get an href attribute in second language.
This only happens for the second language and shortcut pages. example: <a title="Portfolio">Portfolio</a>
I researched a bit in the code and found out that class 'class.tslib_menu.php' throws an exception on line 1173. Because the shortcut-mode-value is zero.
If the same link is generated within the default language the shortcut-mode-value is 1. And the href attribute is added to the a-tag.
I think it is a problem of the shortcut-mode value in the menuArr-Array inside this class.
I fixed this for my case as quick and dirty to force shortcut-mode value to 1
// CHANGED BY ME
if ($this->menuArr[$key]['shortcut_mode'] == 0) {$this->menuArr[$key]['shortcut_mode'] = 1;}
The problem appears in Version 4.7.4 and also in version 4.6.x
You have to set a shortcut mode in the translated content element.
Thanks - this works fine.
The second page-language was pagetype 'standard' while default-language pagetype was 'shortcut'.
This looks like an upgrade issue to me. I fixed this.
But the generated link should - imo - have at least an href-attribute which should point to the page itself as it was a standard page in second language and should therefore link to itself.
So users would be able to point to another page in different languages (p.e. some-parts-are-of-this-site-are-only-available-in-german) or present other content for each language.
- Target version set to 7.2 (Frontend)
- Is Regression set to No
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
I'm having this problem after updating from 4.5.22 to 6.2.14. The hint with updating the shortcut_mode to 1 at the translated entry in the pages_language_overlay didn't solve the problem. I'm still not getting an anchor tag when rendering the HMENU in my second language.
- Status changed from New to Needs Feedback
@Thomas. Can you please provide more information about your setup?
What did you set in the default language?
What did you set in the alternative language?
How does your menu TS look like?
Here is some more information:
I'm setting the languages like this:
[globalVar=TSFE:type=0]
...
seite.config {
linkVars = L
sys_language_uid = 0
language = de
forceTypeValue = 0
htmlTag_langKey = de-at
locale_all = de_AT
}
...
[global]
[globalVar=TSFE:type=1]
...
seite.config {
linkVars = L
sys_language_uid = 1
language = en
htmlTag_langKey = en
languageTranslationnummer = 1
locale_all = en
forceTypeValue = 1
}
...
[global]
And the menu looks like this:
mainmenu = HMENU
mainmenu.entryLevel = 0
mainmenu.1 = TMENU
mainmenu.1.itemArrayProcFunc = user_main
mainmenu.1 {
noBlur = 1
expAll = 1
NO = 1
NO {
ATagParams = class="helvetica-light"
allWrap = <td valign="bottom" style="padding-right:28px;">|</td>|*|<td valign="bottom" style="padding-right:28px;">|</td>|*|<td valign="bottom">|</td>
}
ACT < .NO
ACT {
ATagParams = class="helvetica-light active"
}
}
menuSeperator = TEXT
menuSeperator.value = <div class="menu-seperator"></div>
[globalVar=TSFE:type=1]
mainmenu.1.NO.allWrap = <td valign="bottom" style="padding-right:28px;">|</td> |*| <td valign="bottom" style="padding-right:28px;">|</td> |*| <td valign="bottom" style="padding-right:24px;">|</td>
[global]
[globalVar=TSFE:id=1]
menuSeperator.value >
[global]
Sorry, I don't understand your setup.
You have a condition for the type parameter, but you do not set the typeNum on the "seite" content object.
You define a different language for each type.
You're actually running two different sites in different languages (distinguished by type), but you manage them in the same page tree.
To be honest, I've never seen such a setup before.
I need to think about such a setup and which implications this has for the menus.
- Target version changed from 7.4 (Backend) to 7.5
- Target version deleted (
7.5)
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
You could also join the #typo3-cms channel in Slack if you still need support.
Thank you
Also available in: Atom
PDF