[TYPO3-dev] How to set BE_MOD variables with Typoscript?
Tapio Markula
tapio.markula at atwebteam.com
Sat Dec 9 10:35:04 CET 2006
Zorik kirjoitti:
> Tapio Markula wrote:
>
>> $this->pageinfo['uid'] was empty but the config worked.
>
> empty value equals zero, so that $this->pageinfo['uid']==0. There is a page
> with uid zero - the root page.
> Meaning - you got TSconfig for the typo3 root page.
>
> As for user - it will provide you TSconfig for currently active user - you
> do not have to provide a user id.
>
>> getModTSconfig(99999,....
>> would certainly work too even if it is nonsense.
>
> In this scenario page TSconfig will not exist, but user TSconfig will exist
> and, as user TSconfig overrides page TSconfig - you may get correct result.
>
then there is affect setting id for function calls of getModTSconfig().
But the only reasonable values are then '0' or active page?
The difference is then that if the value is '0' it concerns all trees
but if the value is active page, it concerns just the active tree.
But does this have any sense?
If you go to another branch and you have defined as id the active page,
it works as well as value '0'.
In practise there is no diffence between '0' or active page.
I still don't see any sense id for getModTSconfig().
In TS config for user/user group there is no way to limit in
module configuration the effect for certain branch like there is in TS
Config for pages,isn't it?
Id for getModTSconfig() is reasonalbe *only* if you can set the in
TS config for user/user group and
you have *before* function call a test, if some exists or not, for axample
if($this->modTSconfig['properties]['limitId']) // test if some id has
been set
$id=$this->modTSconfig['properties]['limitId'];
else $id=$pObj->id; // or $id=0
getModTSconfig($id,'mod.XXX')
when
mod.XXX {
limitId=50
}
Now the TS config should work only for page uid 50 and subpages of that
Correct?
BUT now the problem is now that only one id can be set (in practise
concerning one site). Ok this can be changed.
$this->modTSconfig = t3lib_BEfunc::getModTSconfig($pObj->id,'mod.XXX');
$idValues =
t3lib_div::trimExplode(',',$this->modTSconfig['properties']['idValues'],1);
$id=99999999999 // set some irrational value
if(isset($this->modTSconfig['properties]['limitId'])) {
$countlimitId=count($idValues);
$id=99999999999 // set some irrational value
for($i=0; $i< $countlimitId;$i++) {
if($this->modTSconfig['properties]['limitId'][$i]==$pObj->id) {
$id=$pObj;
return true; // if the active page has been found, stop going remaining
values
}
else $id=$pObj;
getModTSconfig($id,'mod.XXX')
when
mod.XXX {
limitId=50,100,501
}
works and you can set TS config for users/user groups in each module
configurations for treelevel!
*but* module configurations should *always* support 'limitId'
or corresponding variable and the check I proposed. Then
the id for 'getModTSconfig' has really some sense. Today it is quite
nonsense because there is no common method to set reasonable alternative
values for '0' or '$pObj'. Correct?
More information about the TYPO3-dev
mailing list