Tuesday, January 02, 2007

Can you externalize Sitemesh layouts?

Let's say your organization has multiple web-apps running and they all currently share the same layout/style. Being the good little developer that you are, you are using CSS to separate the content from style and something like Sitemesh to aid in your layout.

But what if you decide you want to change the layout of all the company's applications? This would entail modifying each application's individual Sitemesh configuration (decorator) and redeploying. Wouldn't it be cool if the Sitemesh wasn't tightly coupled to your webapp and could be accessed from an external source? Wouldn't it be a godsend if you simply had to modify that one Sitemesh configuration and have all the referring applications pick up the changes dynamically (without even redeploying)?

Has anyone ever given any thought to this? Is it possible with the current implementation of Sitemesh?

What I'm shooting for is a global CSS stylesheet stored outside of the webapp's context to enforce a global style for the company's applications, and a "one Sitemesh to rule them all" configuration.

Suggestions/comments?

2 comments:

Matt Raible said...

This may help:

http://raibledesigns.com/page/rd?entry=use_sitemesh_to_decorate_multiple

Wayland Chan said...

Thanks Matt.

One question though, that solution seems to limit you to having that common-decorator application deployed on the same server. I don't suppose that 'webapp' attribute takes a URI does it?