Click here to show or hide the menubar.

Defining the "main" template


New functionality

In the OPML Editor, if you open a template named main, it works the same way it works for any real nodetype, except you edit the main template -- the one that all pages are rendered within.

If it isn't already defined, we copy the main template. If you delete it, you revert to the default template. This makes it possible for us to update any of the templates without stepping on any of your changes. Our updates won't take effect however unless you delete your template (you could of course make a backup copy).

The way it worked prior to this update

Each user has a template in his or her defaultAtts table. It's a copy of the "virgin" template.

Subsequently, we added the ability to name a template, either for one root or for all roots. That took precedence over the other method of defining a template.

How it works after the change

First, we check if you have specified a named template. If so, that's what we use.

Next, we check to see if the user has a main template, if so, that's what we use.

Finally, we use the default main template at worldOutlineSuite.data.templates.main.

Possible breakage

If you had edited your main template, we initialize your new main template with the text from your old one. So everything should continue to work as it did before. But watch out for problems.

If you had previously created a template and stored it in an OPML file, possibly in a Dropbox folder, and were still using that, we now ignore that setting. It seems unlikely that anyone is using this feature because it hasn't been in the UI for quite a while. But it's something to watch out for.

Parts

worldOutlineSuite.data.adminPageTemplate

worldOutlineSuite.data.templates.main

worldOutlineSuite.getMainTemplateText

worldOutlineSuite.initUser

worldOutlineSuite.main

worldOutlineSuite.setDefaultAtts

worldOutlineSuite.templates.getTemplate

worldOutlineSuite.viewPageInTemplate


Posted on Thursday, March 08, 2012 at 11:02 AM by Dave Winer.