You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Proposal: Individual Templates by Action

Status

Proposal under development

Target Release

4.0

Original Authors

Allen Gilliland

Abstract

This is a proposal to support a way to define individual or separate template files for various weblog page actions. Actions would be things like search results page (weblog/search) or tags section index page (weblog/tags/).

Currently Roller does all of its page rendering via a single template, the Weblog template, and quite frankly that is just not good enough. Blogs have many pages which will often times have fairly different designs and Roller should support that. A great example is the search results page which typically has a much different layout and design than a blog homepage and yet Roller doesn't make it easy to accomplish that. It is the goal of this proposal to make it possible for users to have individual templates to control the page designs for various weblog actions.

Requirements

  • 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

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.
    • Templates which are used for specific actions will always have a standardized name, description, and link, so those things cannot be controlled by users. This will behave the same way the current standardized templates (Weblog, _day, _css, _decorator) do, where users may not edit the name, description, or link value for that template.
  • For changes to the rendering system the WeblogPageRequest will be updated to be capable of extracting an "action" based on the request url parsing. this can be accessed and used by the PageServlet (or other servlets) to make the right choice of template to lookup for rendering. if the individaul template for an action is not found then we either use the default Weblog template (search) or respond with a 404 (tags index) depending on how the functionality works now.
  • We can optionally define new Model objects to provide methods which are targeted for use specifically on the various action templates. The best example is how there is a specific SearchResultsModel to be used for displaying search results.
    • We can build on this portion of the design after defining exactly what custom actions will be supported and whether or not those actions would benefit from a custom Model.
  • On the publishing UI the template editing section would remain mostly the same except that the templates list would be changed to highlight those templates which are attached to specific actions. This would be done by something simple like putting these templates at the top of the list and highlighting them in a different color, or something to that effect. This gives us the chance to provide focus to Roller's main templates and hopefully improve the usability of the template editing experience.
    • Also, the "add page" action will be updated to include a drop down list of potential action pages which can be created. if a weblog already has a template for a specific action then it will not show up in the list. the default option will be "custom" which creates a custom template to live under "/page/*" just as the current functionality works.
  • Any new urls which will be enabled to support a new template action will require some updating in the url mapping process and servlets. An example would be the tags index page (weblog/tags/) which currently is not supported and returns a 404 page.

Proposed Actions to Support

  • weblog - this will be the default action and ultimately the same thing as the Weblog template now.
  • custom - represents custom user templates like a stylesheet or an about page.

Comments

Comments ...

  • No labels