Allows users to assign different formats to their entries, which can then be rendered using different templates as supplied by a theme.
A theme must use the
$theme->content($post) syntax for displaying post content to make use of this plugin.
$theme->content($post) is executed normally, a template is chosen for the value of $post that matches its content type, such as "entry.php" for Posts that are of type "entry".
This plugin adds the format as part of the possible template name, so for example, if you select "Aside" as the format, the template that Habari first looks for to display the $post is "entry.aside.php". If "entry.aside.php" does not exist, then "entry.php" is used as a fallback.
A theme can advertise the format templates it supports by implementing the method
filter_get_post_formats($formats). The method should add new format names to the $formats variable and return it. The formats will appear in the list on the post entry page and in the plugin configuration.
It is also possible to add custom formats to the list in the plugin configuration. These formats will do nothing unless the theme includes a matching template, but it does allow the possibility to add a template file to the theme for the format, then add the custom format to the list without altering the theme's class code, which might be handy.
- Author : Owen Winkler
- URL : http://redalt.com/
- License : Apache Software License 2.0
|Download Version||Release Date||Information|