Closed christophlehmann closed 7 years ago
Hi Heiko,
it would be nice to see in in the master branch.
Hi tie-up media,
I would like to make the available templates configurable, without setting the global variable directly. This could be done in an extension manager field
It's very common to have a site extension with version control where you override the extensions default templates and configure such global variables... Configuration in EM often means extra steps when we think about using dev/staging/production systems and should be avoided in my eyes.
but I consider, if it should be done separately for each controller action.?
You are right, the new commit solves this.
...Templales are the first entry point in the view rendering and so it would be possible to include an alternative layout or partials for subelements.
At the moment there are no layouts/partials and a switch viewhelper (in List.html) could do it - without overwriting Extbase default way to resolve the template name for a given action
Viele Grüße, Christoph
Hi tie-up media,
do you merge it when i invest the time to improve the entry point and use the switch for the templates and not for the partials?
Hi Christoph!
Sorry, but I didn't have any focus on this extension for some time. I still think your idea in general is a good one. But before integrating in master, I would like to think about the how one more time in a quiet hour. For now, I'll provide a public feature branch.
The argument to make the setting comfortable to vcs and use in site extensions is a good one, although many extensions use em settings and so you have to handle them in dev/staging/production deployments anyway.
Do you know, if any other public extension focusses the feature of changeable templates?
Dear Christoph,
i now released such a feature in version 0.1.3: https://github.com/tieupmedia/HwtTypo3HwtAddress/tree/0.1.3-beta
I made the available templates configurable via TSconfig in the TCEFORM settings, paired with separate selectfields in the flexform for each action. This way only the available selects & template variants for the current plugin mode are shown.
Furthermore the configuration can be done via backend in the database or included from files, which can be versioned and deployed.
I think you're right to do the including of the templates without overwriting Extbase default way to resolve the template name for a given action! So I called it 'template variants' which are included as partials. But they are separated from other partials by wording and placed into a own subfolder.
Thanks again for your suggestion and feedbacks! I hope this solution will satisfy you, too.
Best regards, Heiko
$GLOBALS['TYPO3_CONF_VARS']['EXT']['hwt_address']['templates']['alternate'] = 'Alternate';
to render the partial Alternate.html