Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules: Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#4053 by Dennis
22 Mar 2017, 16:41
Hello!

On https://aimeos.org/docs/TYPO3/Use_Fluid_templates you describe

Since version 2017.04, you can alternatively use the TYPO3 Fluid template engine for Aimeos templates overwritten for your project. Thus, all your templates will be in the same template language.

...

The Fluid view helpers available by default can't give you access to all data you need. Therefore, the Aimeos package contains some view helpers to retrieve data from Aimeos specific sources like configuration settings or translations. You have to include this view helpers by adding this to the Fluid template before using them:

...



I followed your instructions on the given site and the new fluidtemplate was successfully loaded. But I cannot achieve to access the catalog or product data I need in the templates and give this data out, for example.

My questions are now:

1) How precisely do you access the data you need? Which view helper should I use to get contents like $this->get( 'detailBody' ) ? How can short php blocks before <?php $this->block()->start( ' ... ' ); ?> be realized?

For example, how would you transform a standard Aimeos template like catalog/detail/body-default.php to a fluidtemplate. Could you make it a bit more clear, please?

2) Do some fluidtemplates for catalog list or detail views already exists?

3) What is the current state of development concerning this topic?

Many thanks in advance!

TYPO3 7.6.15, Aimeos web shop 17.3.0, PHP version 5.6.30-0+deb8u1, Linux
#4054 by aimeos
22 Mar 2017, 17:04
Dennis wrote:1) How precisely do you access the data you need? Which view helper should I use to get contents like $this->get( 'detailBody' ) ? How can short php blocks before <?php $this->block()->start( ' ... ' ); ?> be realized?


That's described in the docs: https://aimeos.org/docs/TYPO3/Use_Fluid_templates#Blocks
All data that is retrieved via "$this->get()" or "$this->varname" and "$this->get('detailBody')" is available as "{detailBody}"

Dennis wrote:For example, how would you transform a standard Aimeos template like catalog/detail/body-default.php to a fluidtemplate. Could you make it a bit more clear, please?


That's one of the most complex templates. Fluid is still very restrictive and prevent you from working with the objects in a convenient way. There's a discussion about this in the Fluid repository: https://github.com/TYPO3/Fluid/issues/277

Up to now, it seems you will need a lot of view helpers to retrieve and transform the data according to your needs ...

Dennis wrote:2) Do some fluidtemplates for catalog list or detail views already exists?


No, not that we know.

Dennis wrote:3) What is the current state of development concerning this topic?


It's still experimental. We need people who want to use Fluid for the Aimeos templates and are willing to see what's possible and where the problems are. And to convince the Fluid guys to allow more complex things than just {detailProductItem.name} :-)
#4088 by gilbertsoft
27 Mar 2017, 18:27
Last week I thought about using Fluid templates. Today I have found this interesting post and like to add my 5 cents:

  • How much will the rendering time be affected? But since there are no known templates there wont be an answer for now?
  • Would it be faster enabling the CMS's caching? All Aimeos controller actions are declared non caching as I know.
  • What are the plans with Fluid? Will you use it in other distros too? Complete switch from the current html client or just offering an other templating engine?
#4094 by aimeos
28 Mar 2017, 20:29
The Fluid template engine has an integrated cache, so there is probably a performance loss compared to PHP templates but that might be not that big. We would be interested in figures too :-)

The Aimeos output is non-cacheable because it manages it's own cache and handles non-cacheable parts itself. It doesn't benefit from TYPO3 caching.

Fluid is only an option for TYPO3 and Flow/NeosCMS. In Laravel the Blade template engine is supported instead while in Symfony it's Twig. The default template engine will always be the PHP engine because it's the fastest one available and is the only one that is available in all applications and frameworks.
#4095 by gilbertsoft
29 Mar 2017, 08:07
Thanks for the explanations!

Perhaps someone finds the time to figure this out...

Yes, that's clear. But I didn't know Fluid has it's own caching, I thought it uses TYPO3 cache.

Because Fluid is independant, it should be possible to use it everywhere, isn't it?
#4096 by aimeos
30 Mar 2017, 08:34
The Fluid cache isn't a content cache like managed by the TYPO3 caching framework. It's the result of the transformation of the Fluid templates into PHP for faster execution.

Yes, in theory it's possible to use it in every PHP application but it's not used outside of the TYPO3 and Flow/NeosCMS world yet.