[Typo3-dev] Indexedsearch 2.0

S. Teuber traveler_in_time at gmx.net
Mon Feb 16 18:13:35 CET 2004


Hi there,

>>> Besides, it's just *much* cleaner if the HTML isn't weaved into the 
>>> PHP code. After all, I guess that's why the Typo3-core provides 
>>> template handlers... ;)
>>
>> No, weaving HTML into PHP and using CSS for styling it is beautiful and 
>> very easy to setup quickly.

It *can* be. But there are things that can't be modified by CSS alone, 
especially not if there's old "table layouting" using html-<table>, <tr>, 
<td>-positioning inside the element like it's done in indexed_search. I 
agree that pure css optimized html can be styled in various ways, but the 
code in indexed_search is pretty limited to it's initial layout (being "a 
searchfield with a submit-button *on the right*, *below* that a link" 
etc.). Now what if I want the submit-button below and the "Advanced 
Search"-link to the right? Which magic CSS code will do that?

Having a template with some markers in it *can* do it and is in this case 
much more flexible. But okay, I'm not nound to markers - the approach 
Ingmar posted would be an improvement as well... ,)


>> Often I wish that I didn't implement stuff like the message board, 
>> guestbook and shop with HTML templates - it simply takes too long to 
>> customize those each time and most often I just want to go with the 
>> default structure and change the styling with CSS.

This is only true if you never or seldom need to change the default 
structure. This may apply to you, but different users have different needs.


>> Templating is not a goddess to worship for any cost: it should be a 
>> method we should use when it helps us. Sometimes it just doesn't and 
>> the best way is to hardcode the HTML.

No disagreement on that - I do not worship templating and don't use it at 
all costs...


>> Indexed-search is most likely one of these cases.

That's where I disagree. The flexibility Typo3 provides in designing one's 
own site is one of it's major advantages. You can't tell just by the look 
of the output: "Ah, that's a Typo driven website" (at least if no static 
template is used ;).

The indexed search is stuck with it's one and only structure. Yes, you can 
change some colors or some font faces, but all in all you are fixed to the 
given structure. Unfortunately that structure is not what my customers 
want. And changing the hardcoded HTML in the extension is both a lot of 
hassle and a loss of upgradeability on that extension.

By seperating the business logic from the HTML, and by providing the 
possibility to define a HTML-template using TS, you'd loose the hassle in 
customizing the output suiting your needs, and you'd keep upgradeability, 
which are two important points imo.


>> But of course we can vote for it...
> Yes, I agree.
>
> See also: http://www.massassi.com/php/articles/template_engines/
> In the article they describe a nice PHP-only way of templating that kind 
> of stresses Kasper's point.

Well, that's "HTML with embedded PHP"-driven layout. Honestly I'd be glad 
if the indexed_search worked this way.
Indexed_search does the exact opposite: "PHP with embedded HTML"-driven 
layout.

That may seem a bit odd and "nearly the same", but it just isn't. The 
"templates" in the article above follow the "stream" of the *layout*. You 
can "read" the HTML and have some PHP added where it's needed. With 
indexed_search, all follows the "stream" of the *business logic*, which is 
- of course - much more complex. Scattered around that pretty complex 
php-code are various splishes and splashes of some HTML here, some HTML 
there - that's just not the same.

Maintaining the HTML is much more complicated and thus much more work in 
indexed_search than it would be with a system like the one described in 
that article. Now, what do users probably change more often - the logic of 
the searchengine or the design of the output? I tend on saying: the 
latter. So which part should be easier to work on?

My two cents,

Sven




More information about the TYPO3-dev mailing list