Feature #14575
closedAdd a startUid to a hmenu with special = keywords
0%
Description
I would like to add a new option to a HMENU when special is set to keywords.
I added a 'startUid' option that basicly does the same as the 'value' of the directory option. So instead of supplying a level we can also tell the system to start at a other UID instead of starting at a different level. When the startUid is supplied, the level is ignored!!!
I needed such a option because our website massivly relies on finding pages using keyword. and this way I can show a menu of a other level.
The startUid uses the stdWrap method so users can supply a PHP function (like I do) to find a page within the system.
For example:
lib.leftmenu.100.50.20.special.startUid.postUserFunc.setKeywords = citypage
lib.leftmenu.100.50.20.special.startUid.postUserFunc = tx_ltgextendedmenus_pi1->ts_findPageUid
This means, when I am in a structure BELOW a city like restaurant, hotels etc. etc. then we can show the menu of the city itself. the 'ts_findPageUid' is a little PHP fucntion to find page within out system
I hope it will make it into T# version 3.8.0!
cheers,
Ries
class.tslib_menu.php
LINE548 // start point
$eLevel = tslib_cObj::getKey (intval($this->conf['special.']['entryLevel']),$this->tmpl->rootLine);
-- //$startUid = intval($this->tmpl->rootLine[$eLevel]['uid']);
+ // Get a alternative start UID
+ if ($this->conf['special.']['startUid'] || $this->conf['special.']['startUid.']) {
+ $startUid = $this->parent_cObj->stdWrap($this->conf['special.']['startUid'], $this->conf['special.']['startUid.']);
+ } else {
+ $startUid = intval($this->tmpl->rootLine[$eLevel]['uid']);
+ }
// which field is for keywords
$kfield = 'keywords';
if ( $this->conf['special.']['keywordsField'] ) {
list($kfield) = explode(' ',trim ($this->conf['special.']['keywordsField']));
}
(issue imported from #M839)
Files
Updated by Ries van over 19 years ago
TSREF:
.startUID (+stdWrap) = uid of a page to start generating the menu, the level parameter is ignored when this option is set!
Updated by Riccardo De Contardi over 11 years ago
Could it be closed? As far as I can see in the TSREF:
http://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Hmenu/Index.html#hmenu-special-keywords
It is said, literally:
"Mount pages are supported."
Plus, I see that special = keywords has the value (type:integer /stdWrap) property... isn't it what this issue asked for? Or am I wrong?
Updated by Mathias Schreiber almost 10 years ago
- Description updated (diff)
- Status changed from Accepted to Closed
- Target version deleted (
0) - PHP Version deleted (
4)