[TYPO3-core] RFC #16008: A new TypoScript cObject: FLUIDTEMPLATE

Susanne Moog info at susannemoog.de
Mon Oct 18 20:46:18 CEST 2010


Hey,

On 18.10.2010 11:56, Bastian Waidelich wrote:
> Benjamin Mack wrote:
> 
> Hi,
> 
>> this is a SVN patch request.
>> BT reference: http://bugs.typo3.org/view.php?id=16008

 So the above should be
> protected function FLUIDTEMPLATE(array $conf) {
> right?

Done.

> line 46ff:
>> if (!t3lib_extMgm::isLoaded('fluid')) {
>>     return 'Please install "Fluid" in the Extension Manager!';
>> }
> 
> IMO the message should be more meaningful. E.g. 'You need to install
> "Fluid" in order to use the FLUIDTEMPLATE content element'.
> (the same for the Extbase check in the following lines)

Done.

>> $layoutPath = $templatePath . '/layouts';
> 
> This variable should be named $layoutRootPath I'd say. And I'd vote to
> use UpperCamelCase folder names.
> (The same in the following lines)

Done.

> line 151ff:
>> $view->assign('data', $this->data);
>> $view->assign('current', $this->data[$this->currentValKey]);
> 
> It's possible to override "data" and "current" in the variables
> settings. This might lead to unexpected behaviors. I'd suggest to check
> the existence of $variables['data'] and $variables['current'] and throw
> an exception in case they're overridden..

Done.


> line 158:
>> if (!is_array($cObjType)) {
> 
> What if $cObjType *is* an array? Shouldn't that be handled somehow?

No it shouldn't :) If you have a closer look there, you can see what
happens, if you have some TS like this:

variable = TEXT
variable.bla = blubb

then "variable" is where you need to call cObjGetSingle and "variable."
(the array) is ignored because it's taken into account in cObjGetSingle.

> A few other glitches I came across:
> 
> - Somehow the autoloader is not initialized correctly. Trying to use a
> custom viewhelper like this:
> 
> {namespace t=Tx_BlogExample_ViewHelpers}
> <t:gravatar emailAddress="foo at bar.com" />
> 
> (with the blog_example installed)
> I get the fatal error
> "Class 'Tx_BlogExample_ViewHelpers_GravatarViewHelper' not found"

This may be because the ext_autoload.php of the blog example is broken
(at least the TER version is), the line for the gravatar view helper is
missing. If I add that line manually all works well.

> - Sections do not work as intended(?). At least both examples from the
> Steffens from 16.10. wouldn't work for me.

For me neither until we realized that you have to hand over the used
variables to the section (something like

<f:render section="part2" arguments="{data:data,
variable1:variable1}"></f:render>

should work.


Cheers,

Susanne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16008_v2.diff
Type: text/x-diff
Size: 6812 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101018/c888458e/attachment-0001.diff>


More information about the TYPO3-team-core mailing list