[TYPO3] Can't include "not in menu" pages in path menu using includeNotInMenu property
Ricardo Scachetti Pereira
ricardo at tdwg.org
Wed Jul 5 15:08:22 CEST 2006
A-ha!
This includeNotInMenu problem I reported has been properly fixed in
Typo3 v4.0!! Well done Typo3 developers!!!
See for yourselves:
...
$extraWhere = ($this->conf['includeNotInMenu'] ? '' : ' AND
pages.nav_hide=0').$this->getDoktypeExcludeWhere();
...
$extraWhere = ' AND pages.uid!='.$value.($this->conf['includeNotInMenu']
? '' : ' AND pages.nav_hide=0').$this->getDoktypeExcludeWhere();
...
if (!$data['nav_hide'] || $this->conf['includeNotInMenu']) { //
Not hidden in navigation
...
That's one more reason to upgrade from 3.8.1 to 4.0. That makes 3 or
4 reasons I found just this week.
Cheers,
Ricardo
Ricardo Scachetti Pereira wrote:
> Hi all,
>
> For those struggling with the HMENU.includeNotInMenu property, and
> for future reference, here is what I found about property
> HMENU.includeNotInMenu.
>
> In method tslib_menu.start (file tslib/class.tslib_menu.php line
> 210), there's this code below that handles the property
> HMENU.includeNotInMenu:
>
> ...
> if($this->conf['includeNotInMenu']) {
> $exclDoktypeArr =
> t3lib_div::trimExplode(',',$this->doktypeExcludeList,1);
> $exclDoktypeArr =
> t3lib_div::removeArrayEntryByValue($exclDoktypeArr,'5');
> $this->doktypeExcludeList = implode(',',$exclDoktypeArr);
> }
> ...
>
> What this code above does, to me, is to remove doktypes 5 from the
> list of excluded doktypes in menus if you set includeNotInMenu.
> Apparently, doktype 5 used to be not in menu pages. But I think this has
> changed and now it is coded into the class property nav_hide instead.
> Doktype now seems to show 1 for standard pages, 4 for shortcuts, and
> something else for advanced, etc.
>
> Then in method tslib_menu.filterMenuPages (same file, line 855),
> there is a series of IF statements that test whether a page should be
> included on the menu or not.
>
> ...
> if (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype']))
> { // Page may not be 'not_in_menu' or 'Backend User Section'
> if (!$data['nav_hide']) { // Not hidden in navigation
> if (!t3lib_div::inArray($banUidArray,$uid)) { // not in
> banned uid's
> ...
>
> The problem is that the 2nd IF statement will filter out the
> not-in-menu pages even if you set includeNotInMenu in your TS template.
>
> I really dirty fix (that seems to fix my problem) is this:
>
> ...
> if($this->conf['includeNotInMenu']) {
> $exclDoktypeArr =
> t3lib_div::trimExplode(',',$this->doktypeExcludeList,1);
> $exclDoktypeArr =
> t3lib_div::removeArrayEntryByValue($exclDoktypeArr,'5');
> $this->doktypeExcludeList = implode(',',$exclDoktypeArr);
> $this->includeNotInMenu = 1; // <<<< FLAG ADDED HERE
> }
> ...
> if (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype']))
> { // Page may not be 'not_in_menu' or 'Backend User Section'
> if ($this->includeNotInMenu || !$data['nav_hide']) { // Not
> hidden in navigation // <<<<<< FLAG IS VERIFIED HERE
> if (!t3lib_div::inArray($banUidArray,$uid)) { // not in
> banned uid's
> ...
>
> Note that you will still experience the same (or similar) problems
> if you use HMENU.special property with the following values (and the
> lines causing the problem):
>
> 1) HMENU.special = updated
>
> Line 494: $extraWhere = ' AND
> pages.nav_hide=0'.$this->getDoktypeExcludeWhere();
> // nav_hide is used in SQL statement directly to filter not-in-menu
> pages out.
>
> 2) HMENU.special = keywords
>
> Line 549: $extraWhere = ' AND pages.uid!='.$value.' AND
> pages.nav_hide=0'.$this->getDoktypeExcludeWhere();
> // same thing: nav_hide is used in SQL statement directly to filter
> not-in-menu pages out.
>
> 3) All menus:
>
> Line 2704: if
> (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype']) &&
> !$data['nav_hide'] && !t3lib_div::inArray($banUidArray,$uid)) {
> // Page may not be 'not_in_menu' or 'Backend User Section' + not in
> banned uid's
>
> Note that I can only certify that this applies to Typo3 v3.8.1.
>
> I hope this helps.
>
> Cheers,
>
> Ricardo
>
>
> Ricardo Scachetti Pereira wrote:
>
>> Hi all,
>>
>> I'm trying to set the property includeNotInMenu to 1 (HMENU) to
>> generate a path menu (breadcrumbs). I want to display all subpages in
>> this menu, including those with "not in menu" property set.
>>
>> I tried it in many different ways, but I can't get the "not in menu"
>> pages to show up. Here's a snippet of my template:
>>
>> temp.path = HMENU
>> # Setting the special property to "rootline" - this will produce a
>> "Path-menu"
>> temp.path.special = rootline
>> temp.path.includeNotInMenu = 1
>> #temp.path.excludeDoktypes = 5,6 # I tried this line uncommented, with
>> different values and didn't work
>>
>> # First level menu-object, textual
>> temp.path.1 = TMENU
>> # Wrapping value for the whole menu:
>> temp.path.1.wrap = Path: |
>> temp.path.1 {
>> # Normal state properties appending " > " to all elements but the one.
>> # (See "optionSplit")
>> NO.allWrap = | > |*||*| |
>> }
>>
>>
>> The property includeNotInMenu is described in the documentation
>> (link below), but it doesn't show up on the TSRef browser from my Typo3
>> instance.
>>
>> http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/8/11/
>>
>> I did search for solutions on the mailing list archives, Typo3.org
>> documentation and Google without luck. Google shows some references to
>> others having the same problems, but I couldn't find solutions.
>>
>> I'm using Typo3 v3.8.1 and my templates follow the instructions on
>> Modern Template Building.
>>
>> Any help is greatly appreciated.
>>
>> Best regards,
>>
>> Ricardo
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english at lists.netfielders.de
>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>>
>>
>>
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
>
More information about the TYPO3-english
mailing list