[TYPO3] Example for 'userdefined' for HMENU

Tapio Markula tapio.markula at dnainternet.net
Fri Jun 9 17:41:23 CEST 2006


JoH wrote:
>>Ok. Because I was'n familiar using userdefined
>>I just made a direct hack to class.tslib_menu.php
>>case 'updated':
>>...
>>
>>switch($mode) {
>>
>>case 'newuntil':
>>...
>>}
>>
>>// allow to list also pages, which are normally hidden -
>>
>>if ($this->conf['special.']['excludeNavHide']) {
>>$extraWhere = ' AND pages.nav_hide=0';
>>}
>>
>>$thisTime=gettimeofday();
>>$thisTime=$thisTime['sec'];
>>if ($this->conf['special.']['beforeCurrentTime']) {
>>$extraWhere = ' AND pages.newUntil<='.$thisTime;
>>}
>>
>>The idea of this hack is that it list pages, which should be
>>updated (date of newUntil is older than the currect time)
>>
>>(because that file is often changes XCLASSing
>>is not a working idea).
> 
> 
> Is there any reason for such a hack?
> Why don't you use stdWrap.if or allStdWrap.if for that purpose?

Well I tried it for TMENU object (exactly
for TMENU level 1), which didn't work and I got this answer:

Hi Tapio. I have told you this before. You need to READ the TSRef 
correctly, otherwise you'll never learn it.

In your example you do something like this (I assume that "1" is either 
a TMENU or a GMENU object.):

  1.if {
      value.data = date:U
      isLessThan.field = newUntil
      negate = 0

}

 From READING TSRef, you'll see that none of the TMENU/GMENU objects has 
any
"if" properties.
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/10/1/
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/10/7/
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/10/4/

So that's why your examples doesn't work..


Then I tried other alternatives.
Maybe if under TMENU I have used
stdWrap and putting for some wraps display:none
that might have worked at some way.
Anyway doesn't work for ordinary wraps for TMENU wraps.

In the other hand I need current time unix time stamp (seconds
from 1.1.1970)

  value.data = date:U

does that give it or something else



More information about the TYPO3-english mailing list