[TYPO3-mvc] make plugin USER_INT from flexform

Krystian Szymukowicz k.szymukowicz at gmail.com
Sat Mar 2 18:31:09 CET 2013


hi all,

SCENARIO:

Some actions can be nonCacheable depending on context they are on.

Examples:
a) one can have very rich implemented list action that must be USER_INT 
in some context (for example if fe_user dependend)

b) sidebar search can be cachable on all pages except the search page


PROBLEM:

Right now action can be only cachable or not. So the solution is to add
"List"
"List non cacheable"
"Search form"
"Search form non cachable"

The list with action can be doubled that way and "need programmers time".


SOLUTION:

It would be great to have ability to change the USER_INT based on 
flexform settings of plugin.
So whole plugin no matter of what aciotn is set can be made USER_INT.

This is quite simple in implementation:
FLEXFORM:

         <cache>
             <ROOT>
                 <TCEforms>
                     <sheetTitle>Cache</sheetTitle>
                 </TCEforms>
                 <type>array</type>
                 <el>
                     <settings.cache.makeNonCachable>
                         <TCEforms>
                             <label>Make non cachable</label>
                             <config>
                                 <type>check</type>
                             </config>
                         </TCEforms>
                     </settings.cache.makeNonCachable>
                 </el>
             </ROOT>
         </cache>


Then the TYPO3 sourcecode:
/typo3/sysext/extbase/Classes/Service/ExtensionService.php

public function isActionCacheable

The flexform setting inside this function is available under:
$frameworkConfiguration['settings']['cache']['makeNonCachable']

So its enough to make a condition.



This is how I solved that.


So my quiestion is: is there better way to do it ?



--
grtz
Krystian Szymukowicz




More information about the TYPO3-project-typo3v4mvc mailing list