Forum OpenACS Development: Separating default-master and blank-master

Another thing I've done is split up default-master into two: Default-master and blank-master.

blank-master takes care of things like @header_stuff@, stylesheets, and the form focus feature, things that application templates should be able to depend on. Plus the developer-support link.

default-master takes care of everything that goes inside the browser frame.

By separating these out, it's easy to make a new master template without risking to break the existing functionality like focus, header-stuff, etc.

Should this go in?

/Lars

PS! I happen to be developing on the 4.6 branch right now, though I realize that the community's attention has mostly switched to 5.0. So this will go into 4.6, but get merged to 5.0 whenever.

Collapse
Posted by Don Baccus on
How did you implement this?  By <master> <slave> tags inside blank-master?

Shouldn't we consider discussing changes like this ahead of time, rather than after the fact?

Collapse
Posted by Lars Pind on
Hey, sorry I didn't make this clear.

I haven't committed anything, merely made the change locally for a client project, in fact. I posted to get input on whether this is something we want to include in OpenACS. Sorry that wasn't clear.

Yes, I've done this using standard master/slave stuff. If you specify default-master everything works as normal. Only default-master now has a <master src="blank-master"> at the top.

Here's blank-master.adp:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>@title@</title>
@header_stuff@
<multiple name="header_links">
  <link rel="@header_links.rel@" type="@header_links.type@" href="@header_links.href@" media="@header_links.media@">
</multiple>
</head>
<body<multiple name=attribute> @attribute.key@="@attribute.value@"</multiple>>

<slave>

@ds_link@
</body>
</html>

And here's default-master.adp:

<master src="blank-master">
  <property name="title">@title@</property>
  <property name="header_stuff">@header_stuff@</property>
  <property name="focus">@focus@</property>

<include src="login-status" />

<if @body_start_include@ not nil>
  <include src="@body_start_include@" />
</if>

<h1>@title@</h1>
@context_bar@
<hr />
<slave>

<hr />
<address><a href="mailto:@signatory@">@signatory@</a></address>

Collapse
Posted by Jade Rubick on
What are the performance implications of this? Does the included blank-master get cached? If so, it seems like a good addition to me. Otherwise, it would involve sourcing another file each page access...
Collapse
Posted by Jun Yamog on
Looks good for me.  Since normally I create new templates for my sites, atleast with this I can less worry about keeping my custom templates up to date.
Collapse
Posted by Lars Pind on
http://www.greenpeace.org uses a setup like this, and I believe it isn't hurting performance there.

Both master templates will be compiled into procedures, so the files shouldn't even have to be read, only their mtime checked to see if it has changed.

/Lars