[Typo3-dev] how to create an individual search-form in an extension

Dmitry Dulepov typo3 at fm-world.ru
Thu Oct 27 09:59:25 CEST 2005


Hi!

Jonas Dübi wrote:
> Dmitry Dulepov wrote:
>> - TS (not really convinient to create complex modern UI)
> Of course TS is a little more complicated than Smarty, but if you use
> modern HTML with good CSS skills, it's not that hard...

I meant only that writing something like
======================================
page = PAGE
page.10 = TEXT
page.10.value = <div class="wrap">
page.20 = TEXT
page.20.value = <div class="menu-block">
page.30 < temp.menu
page.40 = TEXT
page.40.value = </div>
page.50 = TEXT
page.50.value = <div class="content-block">
page.60 < temp.content
page.70 = TEXT
page.70.value = </div>
======================================
is not the best way of templating. Surely you can use stdWraps to make
all this thing shorter (and more complicated to understand) but i still
prefer:
======================================
<html>
<head>
<title>My site</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div class="wrap">
  <div class="menu-block">{generateMenu}</div>
  <div class="content-block">{generateContent}</div>
</div>
</body>
</html>
======================================

> The main Point why you shouldn't use Smarty isn't if it's better, it's
> just because it's not the Typo3 way. If you don't like this one, improve
> it, make suggestions but pleas don't use something completly diffrent...

See "important thing" below. I only want to note that MTB (and
TemplaVoila) is also "not TYPO3" way than :)

> That's one of the biggest problems of PHP, everyone uses his own way of
> solving things...

Well, this is not the problem of PHP, this is a problem of the world...

> I would love to develop BE Applications with the PRADO Framework,
> because I know it and I realy realy like the way it does things.
> But I would never hack it into my Typo3 extensions, because that would
> be as if you connect a Porsche engine to the window-cleaner of an big
> airplain :-D.

Well, I rather see it as connecting Ferrari engine to a BMW car. Gives
new powers though may require integration effort.

One important thing: I do not vote for Smarty to become TYPO3's template
engine! This would be really bad idea. But I think (and proved to
myself) that Smarty can be used as a local template engine in
specialized plugins. Often this is much easier than MTB way.

Actually Smarty templates is much easier to localize than MTB templates.
Imagine that you need to put markers for each label in the template and
replace them. Many of them! With Smarty I just added a custom extension
function (PHP file with 5 lines in it) and now I can use text from
locallang files directly in Smarty templates! One template works with
all languages, I neither need to modify template, nor to add other
templates when extension is translated or translation is modified.

Dmitry.




More information about the TYPO3-dev mailing list