Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • define a list of supported weblog actions which will have associated templates.
  • provide a way for packaged themes to make use of these individual templates.
  • maintain backwards compatability for upgrading customers, so these templates cannot be required.

Issues

There is one issue with the potential for leftover templates to affect a theme which needs to be addressed.

There is one somewhat yucky issue that has come up after I did the implementation work. Since these templates are optional and may not all be present in all themes there is a potential problem with action templates being left around from previous themes when the user changes their theme multiple times.

For example, assume ThemeA defines a 'permalink' template. The user chooses ThemeA and decides to customize it, so the templates are copied. Then the user changes their mind and decides to use ThemeB, which does not have a 'permalink' template. At this point the user has a 'permalink' template in their templates section left over from their previous theme which will likely cause problems when rendering their new theme. So, how should we handle this?

1. When rendering templates by action from a theme we ignore custom templates from the weblog for specific actions. This prevents the scenario above because when using a shared theme we would not look for the 'permalink' template in the users custom templates. The drawback is that this prevents the user from creating a template for a specific action if their theme doesn't do it for some reason.

2. Accept that this is a potential problem and let users deal with it themselves by deleting these left over templates. Not exactly a pretty solution :/

3. Force all themes to implement all action templates moving forward. This is probably the cleanest and most ideal solution. Also remember that with the new theme metadata file it's entirely acceptable to define 2 templates in the theme using the same physical file, so the templates for 'weblog' and 'permalink' actions could both use the same Weblog.vm file. Issues to be considered

Design

First we will introduce one new db column to the webpage database table named "action". During the upgrade process all existing 'Weblog' templates will be updated to action "weblog" while all other pages will be given action "custom". Then moving forward we can add support for any new actions we need. This will be the only change required in the data model.

...