Hello Reinoud, this is Mike Austin from hi5...
Evan and I have been talking offline a bit about templates, especially
about localization. The main feedback from our developers was to make
it easy to write localized apps without much work. An option is to
provide a default message in an <os:Message> type tag, and possibly
extracting this information to build a resource XML file so developers
don’t have to think so much about managing resources.
There are a few possibilities for the message tag itself, with pros
and cons:
* Tag based, attribute parameters
<os:Message key="gave_gift" gift=”${theGift}” /> or
<os:Message key="gave_gift" gift=”${theGift}”>Optional default message
${gift}</os:Message>
The nice thing about this is that it’s short. The issue is that it
can’t be XML validated because you’re passing dynamic attributes.
* Tag based, tag parameters
<os:Message key="gave_gift">
<os:Param key="gift" value="${theGift}">
<os:DefaultText>Thanks for the ${theGift}</os:DefaultText>
</os:Message>
This validates, but is quite a lot to type. Our developers would
prefer the least amount of overhead.
* Attribute based, attribute parameters
<span msgId="gave_gift" gift=”${thiGift}” />
This goes more in line with a “microfotmat” style, and is possibly the
shortest. The issue is that if you start overloading attributes to do
different things, it can get confusing – for example when you provide
conflicting attributes.
As for the <if> <else> <repeat> tags, I am somewhat a fan of this
also. It is true, as Evan said, that sometimes the logic can start
dominating the markup. I guess it depends on your style. Maybe we
can have our cake and eat it too?
Regards,
Mike Austin
PS, I can't seem to add another address to this account so I can post
from my hi5 address. I guess I just need to create another account?
On May 12, 4:53 pm, Evan Gilbert <
uid...@google.com> wrote:
> Hi all - I'm restarting the thread on adding template support to OpenSocial.
> Templates will be discussed in detail at the OpenSocial
> summit<
http://opensocialapis.blogspot.com/2008/05/opensocial-summit-may-14th...>this
> upcoming Wednesday - please attend and join in the discussions if you
> have an interest in the subject.
>
> Draft proposal is up athttp://
groups.google.com/group/opensocial-and-gadgets-spec/web/openso....
> Once we get agreement on the basics we will follow up with a more formal
> spec document.
>
> Some notes on the proposal:
>
> - You can embed template content directly into gadget <Content> sections
> or HTML documents using a <script> tag.
> - OpenSocial tags are prefixed (by convention) with "os:". However the
> templating system supports multiple markup libraries - containers, library
> developers and gadget authors can all define their own tags.
> - Templates can be processed using just a JavaScript include. The
> language also supports server-side processing for performance or security.
> - Expressions in templates can reference data returned from OpenSocial