[TYPO3-ect] Your experiences with Smarty
Martin Kutschker
Martin.Kutschker at n0spam-blackbox.net
Thu Mar 8 17:09:43 CET 2007
Steffen Kamper schrieb:
> "Ernesto Baschny [cron IT]" <ernst at cron-it.de> schrieb im Newsbeitrag
> news:mailman.1.1173348734.17871.typo3-team-extension-coordination at lists.netfielders.de...
>
>>Steffen Kamper wrote: on 08.03.2007 10:16:
>>
>>
>>>>Hello Ries, Steffen and others,
>>>>
>>>>meanwhile you have done some experiments with lib/div and Smarty. I
>>>>didn't
>>>>work with it myself. I would like to find an answer to this question:
>>>>
>>>>Do we need a Smarty connector object (smartyView)?
>>>>
>>>>Maybe Smarty has an API itself that doesn't need a special connector
>>>>object. Maybe such an object could be of help.
>>>>
>>>>What is your experience? What is your vision?
>>
>>>Ries build up a gallery with lib/div and smarty and we discussed a lot.
>>>First we moved to rpt_smarty because it's the better ext, later update
>>>(but
>>>still has to be updated)
>>>
>>>Then smartyView is used as central point for
>>>- initializing smarty
>>>- assigning values
>>>
>>>As you mentioned, there are several ways to use smarty, if smarty is
>>>initialised, you can assign values from every place.
>>>But to keep the model of MVC clear and the methods transparent, i would
>>>say
>>>yes.
>>>
>>>I will do some improvements too and will update the smartyView at WE.
>>
>>That sounds cool. One feature I would love to see in one "official ECT"
>>approach with Smarty would be a way for a developer to ship default
>>Smarty templates, but the smarty class flexible to load templates from a
>>custom path on demand. So I would configure:
>>
>>plugin.tx_myplugin.smartyTemplates = fileadmin/tx_myplugin/templates/
>>
>>The extension developer would ship his extension with:
>>
>>typo3conf/ext/myplugin/templates/singleView.html
>>typo3conf/ext/myplugin/templates/listView.html
>>typo3conf/ext/myplugin/templates/headElement.html
>>typo3conf/ext/myplugin/templates/....
>>
>>And I would be able to override any (or none) of those in my own
>>template directory:
>>
>>fileadmin/tx_myplugin/headElement.html
>>
>>This way I can alter just what I need but still use the extensions
>>templates. It is always a pain in the ass if I have a "all or nothing"
>>template like in sr_feuser_register: If I need a minor customization
>>there, I need to copy the ENTIRE template over to fileadmin, and will
>>probably miss new features introduced in later releases when I upgrade.
>>
>>I have done this in my own (non-TYPO3) project that use Smarty by using
>>"register_resource" and then overwriting _fetch_template_info to change
>>the default from fetching single files to searching for them in a
>>"search path". Maybe there is an easier way nowadays with smarty (this
>>was done some yeeeears ago already).
>>
>>What do you think?
>>
>>Cheers,
>>Ernesto
>
>
> Hi Ernesto,
>
> with rpt_smarty this is no problem, because you can change templatePath with
> one line:
> $this->smartyconf = array (
> 'path.' => array (
> 'template_dir' => $this->templatePath,
> ), 'config.' => array (
> 'caching' => 0,
> 'debugging' => 0
> ));
>
> These options will be implemented in smartyView as well to show the users
> how to configure and set options to smarty.
But that's the PHP part. I think Ernesto wants a standardized TS config for
changing the template path.
Masi
More information about the TYPO3-team-extension-coordination
mailing list