[Helma-dev] Helma Templating
Franz Philipp Moser
philipp.moser at chello.at
Fri Dec 2 11:41:41 CET 2005
Hi,
Juerg Lehni wrote:
> Hi Philipp,
>
> Great, I think we fully agree!
Cool, sounds great.
> Am 02.12.2005 um 10:09 schrieb Franz Philipp Moser:
>
>> Hi Jürg,
>>
>> Juerg Lehni wrote:
>>
>>> Hi Philipp,
>>> Am 02.12.2005 um 08:50 schrieb Franz Philipp Moser:
>>
>> <snip />
>>
>>> I agree that from a template designer's view, the helma approach
>>> feels much cleaner. And I think I understand now what the source of
>>> our disagreement is: Fundamentally different project teams. I
>>> usuall work on web apps on my own, and except the screendesigns
>>> where I often work with a designer together, I built everything
>>> else myself. And in such a case, such splitting up of things that
>>> belong together just feels like tripping myself up all the time.
<snip />
>>> But why not having something like my latest proposition, where
>>> Helma tags work just like they did until now, and additionally,
>>> embeded logic is possible for those who want to use it? It could
>>> even be something that's disabled by default, as a security
>>> messure, and can only be turned on when needed, with an additional
>>> parameter. Like this, we wouldn't even need a scope based secury
>>> system, we could just turn off logic for untrusted skin editors.
>>
>>
>> That sounds very good, +1 for that. I think this can go so far that
>> each prototype is configureable. So you can allow it for some
>> prototypes and for some not and each prototype has a default behavior.
>
>
> That's an interesting idea. It's things like that we need to find out,
> I think. My idea was to use a global switch for the app (default is
> off), and an additional possibility to turn it on on a call-by- call
> basis (I'm using telecommunicatioin tounge now : )
>
> It could be a property passed in the param value:
>
> this.renderTemplate("name", { foo: "Bar", _allowLogic: true });
>
> Similar to this, we could also implement chris' idea of defining
> alternative scopes:
>
> this.renderTemplate("name", { foo: "Bar", _allowLogic: true, _isRoot:
> true, res: res, session: session }); // request / response are not
> exposed!
>
> if _isRoot is set, the param is used as a root object instead of the
> global scope.
Maybe we could do it without changing the renderTemplate (renderSkin)
function by setting it for the prototype.
HopObject._prototype._allowTemplateLogic: false;
SomePrototype._prototype._allowTemplateLogic: true;
Since HopObject is the Prototype of all other Prototypes we can
overwrite it for every newly generated prototype.
The second line can go to the onRequest function and can be set
according to the user rights for example.
But as you mentioned flexibility :) using special params in
renderTemplate should also be possible and promote on helma.org witch is
the prefered way to use this feature!
<snip />
>> Just another example. creating a website with dreamweaver or some
>> other WYSIWYG Editor is much faster that doing it by hand with css
>> and html seperated. So what is the better solution for a small firm?
>
>
> That's one of those analogies. :-) I think you can't really compare
> this to what we discuss, because both solutions are not doing things
> behind your back without us knowing what the result is (Dreamweaver
> does...). But I see what you mean.
Now I'm happy :)
>> Now the conclusion of our discussion, please tell me if you agree:
>>
>> *) flexability is the key
>
>
> +1
>
>> *) making the template engine configurable to allow/disallow function
>> in templates
>
>
> +1
>
>> *) giving the template engine a good restricted default behavior
>
>
> +1
>
>> *) Promote good Template programming on helma.org but show developers
>> that other things are also possible.
>
>
> + 1
>
>> > starts to feel teachy-preachy.
>>
>> Sorry but I'm a little idealistic in such things, I keep my mouth
>> shut for now :)
>
>
> I didn't mean you were getting teachy, I just meant that a too dogmatic
> API gives the user this feeling. Of course it's great to be idealistic,
> I'm idealistic about many things as well, and I think we wouldn't
> discuss anything here and still code in PHP if we weren't.
Yeah so it would be. I think we can add as much flexability as we can,
but allways try to promote the "good things" in the documentation on
helma.org.
> Jürg
>
<snip />
cu Philipp
--
XML is the ASCII for the new millenium
(Cocoon Documentation)
More information about the Helma-dev
mailing list