Skip to content

Template Table Reference

mikert edited this page Mar 21, 2011 · 1 revision

Purpose

This table stores the templates that Melody uses for building web pages and other content. In some cases, it will contain the actual templates, in orders it will contain pointers to the real templates which are stored on the file system instead of the Melody database. The latter is true when a user or theme designer has elected to use the "link to file" option in the template editor or a config.yaml file.

Fields

  • template_id - integer not null auto_increment - The table's primary key.
  • template_blog_id - integer not null - The blog that owns the template.
  • template_name - string(255) not null - The display name/label of the template.
  • template_type - string(25) not null - The type of the widget. Common values include:
    • archive
    • custom (modules)
    • individual
    • main_index
    • search_results
    • widget
    • widgetset
  • template_outfile - string(255) not null - The file which will be produced when the template is published. This applies only to index templates.
  • template_text - text - The contents of the template.
  • template_linked_file - string(255) - The path to the file which holds the template if this template record is linked to one.
  • template_linked_file_mtime - string(10) - The modified time for the file linked to this template record.
  • template_linked_file_size - integer - The size of the file linked to this template record.
  • template_rebuild_me - boolean - A boolean flag which if disabled will prevent this record from being published.
  • template_build_dynamic - boolean - A boolean flag for enabling/disabling dynamic publishing.
  • template_identifier - string(50) - A unique identifier key (unique within a blog) for a template. This field is important as an alternative to loading templates by their name because the template's name field is translated to the blog's localized language when a theme is applied. What this means for theme designers is that if do <mt:Include name="Header"/> in your theme, when applied on a blog with a different language, the name "Header" will be replaced with the local language's word for it and thus the Include tag would break.
  • template_build_type -smallint - Melody has several different ways of handling a template. The value is one of the following options for how it will be built:
    • 0 - Do not publish.
    • 1 - Static publish.
    • 2 - Manual publish.
    • 3 - Dynamic publish.
    • 4 - Publish queue.
  • template_build_interval - integer - TODO: Document

Meta Fields

  • last_rebuild_time - integer meta -
  • page_layout - string meta - This is a string field which is used to help theme designers use codes to describe a page layout scheme in the event that their theme supports multiple layouts. For example, a template could have "2col-1w1t" which would indicate "2 columns, 1 wide and 1 thin."
  • include_with_ssi - integer meta - If this is a module or widget, enabling this boolean flag will result in Melody using a serverside include to import this template.
  • cache_expire_type - integer meta - If caching is enabled, this field will have one of two values:
    • 1 - Expire based on time interval.
    • 2 - Expire based on an object creation event.
  • cache_expire_interval - integer meta - The amount of time that is supposed to pass before a cached object expires.
  • cache_expire_event - string meta - The types of objects that, upon creation, will cause this template's cached object to expire.
  • cache_path - string meta - TODO: Document
  • modulesets - string meta - For widgetsets, this is the list of template ids that correspond to the widgets in the widgetset.

Indexes

  • blog_id
  • name
  • type
  • outfile
  • identifier
Clone this wiki locally