[TYPO3-mvc] FlexForm configuration cannot be retrieved anymore
Bastian Waidelich
bastian at typo3.org
Mon Nov 23 12:18:59 CET 2009
Steffen Kamper wrote:
Hi Steffen & co,
> sry to say, but i don't like the solution. It's a good example that
> magic makes things complicate and unflexible.
while I agree that the breaking change is unfortunate I wouldn't call it
complicate and especially not inflexible. but maybe we didn't
communicate it very well. So let me try to clarify this a bit:
with the good old pi-base-way the configuration of an extension is one
big array of keys and values. there are best practices, but you're free
to setup your config TS tree like you want.
than came the flexform and people started to merge flexform settings
with the TS config (which is really convenient IMO cause it allows you
to override settings per instance without the need to insert additional
TS templates).
now that we're heading in a "convention over configuration" kind of way,
we decided to split up the configuration into different parts, namely:
"persistence" for setting storage related options like storagePid.
"view" for view related configurations like template paths
"_LOCAL_LANG" to be able to overwrite localized labels
and "settings" for (and that's a main difference) setting up
configuration options that do not belong to extbase but to the very
domain of your extension (like "postsPerPage", "skin", etc). Those
settings will be available in your template automatically
({settings.postsPerPage}).
i hope this far you're still with me, cause in my eyes this is just
consequently going in the direction of FLOW3 where you have different
configuration files per package.
now we had to find a way on how to get this into your TS & flexform setup..
we started by merging the flexform values with the "settings" part of
the TS config. that way you could easily override your plugin settings
from flexforms.
But what if you wanted to override e.g. the template root?
i see three possible solutions to this scenario:
1. insert a new TS template to the page in question - cumbersome and
only works per page not per plugin.
2. set the template path in the "settings" part of your extension and
pre-process it in your controller - ouch.
3. add another "level" to the flexform.
we went for #3 and i like this solution the best and actually i think,
it's quite stringent:
"old" way:
#TS:
plugin.tx_blogexample {
foo = bar
}
#flexform:
<foo>
<TCEforms>
...
</TCEforms>
</foo>
"new" way:
#TS:
plugin.tx_blogexample {
prefix.foo = bar
}
#flexform:
<prefix.foo>
<TCEforms>
...
</TCEforms>
</prefix.foo>
i know, the additional level is a bit unfamiliar - but there is more to
get used to when you start working with extbase & fluid anyways.
hopefully i could somehow convince you.. or do you have a better
solution in mind?
Best,
Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list