[Typo3-dev] Smarty integration
Bart Veldhuizen
bart at vrotvrot.com
Sun Dec 7 14:07:14 CET 2003
Hi,
I have been learning Typo3 for the last few weeks and I think it's an
amazing tool with a wonderfully active and supportive community. At this
moment, I am trying to determine if we can use Typo for the new websites
of Blender, a GPL 3d modeling/animation tool (see www.blender.org).
Also, people at my job are quite impressed with Typo's qualities and
have already started discussions of replacing some Tridion installations
with Smarty. Not bad! :)
While I understand Typoscript and I think it's quite good for
configuration issues, I find that it makes templating websites overly
complex. Worse, I'm afraid that it's quite hard to maintain. The people
(volunteers) who will be helping us are quite knowledgeable in PHP and
also in Smarty. Since I couldn't find any plugins that support Smarty,
I've started to work on one myself to see if it could be done. Based on
the css_styled_content plugin, I've created a plugin that renders the
default content types with simple Smarty templates such as:
{* render bullet lists *}
{if $cObj.CType == 'bullets'}
{if $cObj.header != ''}
<h2><font color=blue>{$cObj.header}</font>
{$headerEditIcons}</h2>
{/if}
{foreach from=$lines item=line}
<li>{$line}
{/foreach}
{$editIcons}
{/if}
Ultimately, I would like to replace the template auto parser with a
Smarty template as well.
My questions are these:
- While I feel that this is within my reach, I run into some problems
because most of the core functions of Typo generate full HTML instead of
'clean' content structures. For example, in
class.tslib_content::IMGTEXT(), I would like to receive the 'bare' data,
unmixed with HTML. The only solution that I have now is to parse the
results and rebuild the data myself - definately not a very robust
solution ;-) Are there any hooks into Typo that would allow me to do
this? Alternatively, are there any plans to further separate content and
presentation?
- Does my Smarty approach make sense, or have I completely missed the
concept of TypoScript and should I just study a bit longer?
- Are there any Smarty integration projects going on already? I couldn't
find anything on the web, but I would hate to duplicate someone else's
work..
I hope I've come to the right place for these questions.
Cheers,
Bart
More information about the TYPO3-dev
mailing list