[TYPO3-core] Bug 633

Holzinger Franz franz at fholzinger.com
Tue Jan 3 13:20:19 CET 2006


Hello Bernhard,


from the TSRef documentation:

> If .value is not set, the default uid is the .entryLevel uid.

Maybe this is missing in your code.


>                 foreach($this->tmpl->rootLine as $page)    {
> +                    if (t3lib_div::inArray($items, $page['uid'])) {
> +                        $this->directoryLevel = $idx;
> +                        break;
> +                    }
> +                    $idx++;
> +                }

This would be a usefull general function to get the depth of a page to
the rootline.

In t3lib/class.t3lib_tstemplate.php line 442 you have

> $this->rootLine[] = $this->absoluteRootLine[$a];

You have written:

> +                if
> ($this->tmpl->rootLine[$this->entryLevel+$this->menuNumber+$this->directoryLevel]['_MOUNT_OL'])  
>  {    // In overlay mode, add next level MPvars as well:
> +                    $nextMParray[] =
> $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber+$this->direcotryLevel]['_MP_PARAM'];
>                  }

So hopefully this works, however you are relying here on the index
number of rootLine in the template object. This is however not
documented anywhere that you can rely on this index number. Or am I
missing something?

I cannot believe that this works:

> $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber+$this->directoryLevel]

$this->directoryLevel are e.g. numbers from 1 to 10. This is added with
entryLevel and the menuNumber to give the index of the rootLine array.
Or is only one number valid at a call of this function?

> direcotryLevel

--> directoryLevel


Greets,

Franz












More information about the TYPO3-team-core mailing list