Bug #20018
closed
Mount points does not fully supported by HMENU TMENU (CUR and ACT not works)
Added by Valery Romanchev almost 16 years ago.
Updated almost 5 years ago.
Description
CUR and ACT does not work for this simple menu in the section of web-site, that was mounted using Mount Point.
"Substitute Mount Point (this page) with Mounted page" is set to Yes.
In original section this menu works OK
lib.menu_left = HMENU
lib.menu_left {
special=directory
special.value.data=leveluid:2
1 = TMENU
1 {
wrap = <ul >|</ul>
noBlur = 1
expAll=1
NO.wrapItemAndSub = <li>|</li>
ACT = 1
ACT.wrapItemAndSub = <li>|</li>
ACT.ATagParams = class="current"
}
}
(issue imported from #M10439)
- Category deleted (
Communication)
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
- Status changed from Needs Feedback to Closed
- Is Regression set to No
No feedback for over 90 days.
This is still a problem in 6.2.13.
With with special = directory or special = list, ACT and CUR is not working for mounted pages! (other special values not tested)
It works, when using entryLevel instead of special.
i think we have the same problem on T3 6.2. we have a HMENU with entrylevel 0 and a few mount points.
the menu works fine, but if you click on a link which is a mounted page in the tree, and you are there, then the url from the original page (the page you see, the page which is mounted) is wrong in the menu. it has the url from the mounted page you already clicked. i don't fully understand the behavior, but i think it goes in the same direction. mounted pages, hmenu and the active state.
Still not working in 6.2.15.
Since I don't expect this to be solved in the near future, I think a notice/warning in the Typo3-documentation is necessary. Users should be aware that HMENU won't work as expected when using mount points.
- Status changed from Closed to New
- Related to Bug #80970: [HMENU][Introduction package] Parallel mount points don't work added
- TYPO3 Version changed from 4.2 to 7
I just discovered this in TYPO3 7.6.16
- HMENU, but no matter if special=directory or entryLevel
- There is a "Mount point" page (the "copy", pid 26) and a mounted page (the "original", pid 207)
- The setting is "show contents from Mounted page"
- We navigate to the "copy" page (26), so it is current
- In the HMENU, the link to the current page is http://www.example.com/index.php?id=207&MP=207-26, which is fine
- But also, the link to the "original" page (207) is http://www.example.com/index.php?id=207&MP=207-26, so acually instead of linking to the original, it links to the "copy", which is superbad!
- This also happens if you set CUR = 0, but only on the current page
Are there any alternatives or workarounds? Maybe v:menu?
- PHP Version changed from 5.3 to 7.0
Could this be happening in typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php ?
Not sure if this a bug that has persisted for so long because it affects few people or because it's hard to tackle, so taking a look...
I don't trust it yet, but it might be that config.MP_disableTypolinkClosestMPvalue = 1 helped...
It seems that helped!
What leads us to getClosestMPvalueForPage() in ContentObjectRenderer():
/**
* Returns the &MP variable value for a page id.
* The function will do its best to find a MP value that will keep the page id inside the current Mount Point rootline if any.
*
* @param int $pageId page id
* @param bool $raw If TRUE, the MPvalue is returned raw. Normally it is encoded as &MP=... variable
* @return string MP value, prefixed with &MP= (depending on $raw)
* @see typolink()
*/
public function getClosestMPvalueForPage($pageId, $raw = false)
... what could be the use case for this method?
Nah. It's just broken. IMHO Mount Points should be removed.
And to not only rant, here's a quick & not-so-dirty solution for (very) simple mountpoints that can be configured via TS per page.
Supposing all your content is being read out via styles.content.get, for example:
lib.h1 < styles.content.get
lib.h1.select.where = colPos=1
and then used in a fluid template.
Make a TS file that adds to all those statements:
lib.h1.select.pidInList = {$pids.pidMountedPage}
Include this file and set the constant. Done. Of course this is not recursing and doesn't add the page to the menu, and editors can't handle it themselves. But it's much more convenient than to include referenced content per insert-records. Also, if editors add an item on the source page, it will automatically find it's way to the target page.
- Category set to Frontend
- Tags set to mountpoints
- Status changed from New to Closed
In case you wondered - config.MP_disableTypolinkClosestMPvalue is a must have in order to use proper links with mount points in my opinion. Just retested this in TYPO3 v9 and TYPO3 v10 and using this option solves all issues. I will close this issue as it is fixed IMHO. If you feel otherwise, let me know, I will then re-open the ticket.
Also available in: Atom
PDF