[TYPO3-templavoila] Adding tt_content record uid to FCE pseudo-record in tslib_cObj

Lucas Thurston lucas at castironcoding.com
Sun Apr 9 17:09:25 CEST 2006


Now that I think of it, it'd be nice to have a running count on 
repetitive data objects in an FCE that was accessible through 
{field:count}.  One could, in this case, produce a unique identifying 
string from TypoScript for each repeating object:

temp = TEXT
temp.value = <tag id="{field:uid}_{field:count}">Blah blah</tag>
temp.insertData = 1

The FCE could then pick up temp.

Any thoughts on this?

Lucas
Cast Iron Coding

Lucas Thurston wrote:
> Hi everyone,
> I had a problem that I was unable to solve except by modifying 
> tx_templavoila_pi1.  I think it's a very useful feature so I'm hoping 
> that someone can either offer a better solution to me, or if Robert 
> could add my code or something similar to it in the next version of TV.
> 
> Here is the problem:  I created an FCE in which I needed to give a div a 
> unique (and repeatable) id so that I could toggle its visibility with 
> javascript.  I tried accessing this data from TypoScript like:
> 
> lib.bioFceToggleJS = TEXT
> lib.bioFceToggleJS.dataWrap = toggle('bio{field:uid}');return false;
> 
> but, the uid isn't among the fields that are accessible from an FCE, 
> since an FCE is defined in the XML of the tt_content record then passed 
> to tslib_cObj.  So, I made the following modification to 
> class.tx_templavoila_pi1.php (my code noted):
> 
> $tsparserObj = t3lib_div::makeInstance('t3lib_TSparser');
> $cObj =t3lib_div::makeInstance('tslib_cObj');
> 
> // add tt_content record id to FCE pseudo-record passed to tslib_cObj
> $dataRecord['uid']=$this->cObj->data['uid'];
> // end modification
> 
> $cObj->setParent($this->cObj->data,$this->cObj->currentRecord); 
>                              $cObj->start($dataRecord,'_NO_TABLE');
> 
> Obviously, this is not an acceptable solution in the long-term, and I 
> was hoping someone could point me to a better way to accomplish what I 
> need to do, or include my code, or something like it, in the next 
> version of TV.
> 
> Thanks,
> Lucas Thurston
> Cast Iron Coding



More information about the TYPO3-project-templavoila mailing list