# [Seaside] Newbie questions

Julian Fitzell seaside@lists.squeakfoundation.org
Tue, 13 Aug 2002 15:35:19 -0700

Julian Fitzell wrote:
> Felix Franz wrote:
>
>> Hi Pablo,
>>
>> Pablo Iaria wrote:
>>
>>> Thanks a lot for answering !
>>>
>>> Unfortunately it didn't works as expected....
>>>
>>> I have a html file with:
>>> <html>
>>>     <body>
>>>         <mytestcomponent sea:id="testing"></mytestcomponent>
>>>     </body>
>>> </html>
>>>
>>> I set the "Document Root" property with the file path and I added the
>>> "template" method you told me earlier but I got the
>>> "MessageNotUnderstood:
>>> children"  message.
>>
>>
>>
>> changing the method to:
>>
>> template
>>   template ifNil:
>>     [template := IAFileTemplate new file: 'foo.html'; model: self.
>>   ^ template
>>
>> worked for me. (model: self is used in IAPage>>template)
>
>
> Yup, you got it exactly right... I was modifying code from an older
> example and missed that change...
>
> But, in the process of testing to find that I've found another
> problem...  If you modify a file-based template then you get errors when
> it gets reloaded until you start a new session... I'm looking to see if
> I can find a fix.

Actually, I think a cleaner way to do this would be to override
buildTemplate:

buildTemplate
template _ IAFileTemplate new
file: 'c:\foo\bar.html';
model: self.

It also seems that I was wrong and it does not use the document root so
you should give a full path to the template.  As you can see no one much
has been using this lately :)  I do think it's an important feature though.

I've filed bug #106

That said, I am in the process of working on templates and stuff in
Seaside 2.  If anyone has any suggestions about how confiuration for
paths for templates, etc should work I'd be happy to hear them.

Obvious options are:

1) always give a full path to a template
2) always put them in a teplates/ folder in the squeak dir or something
3) something else?  Templates are associated with a component more than
an application so configuring it in the application config app (like the
document root) doesn't make a whole lot of sense.

Julian

--
julian@beta4.com
Beta4 Productions (http://www.beta4.com)