Skip to content

designguide theme prefbundles

mikert edited this page Feb 14, 2011 · 2 revisions

MTDG: Preference Bundles

Introduction

Preference bundles are a way that a theme designer can control the way that Melody will behave once a theme has been activated. The range of options that can be specified is very large covering everything from who can comment on the published site, to how spam is handled among other important settings.

As shown below, even plugins can be configured by a preference bundle. In the sample, rebuild_for_action_stream_events is a setting from the Action Streams plugin. If you open the config.yaml file for Action Streams, you will see a YAML branch with that name and the value specified in the bundle below will override whatever was chosen before once the user chooses to use your theme.

Themes can contain multiple preference bundles. If you are a theme designer who wants to reuse the same settings, you can even package a common bundle in one plugin. All you would have to do is create a config.yaml file that defines a basic plugin, put your preferences bundle at the bottom of the file and then instruct your users to download it along with your theme.

The example used below is ready for a designer to copy and paste into their own config.yaml file. The only thing that needs to be changed is the references to "DePoSkinny" need to be replaced with the new theme's name.

Example

    blog_preferences:
        DePoSkinny_theme_preferences:
            label: 'DePoSkinny Theme Preferences'
            description: 'Preferred preferences for the DePoSkinny Theme'
            plugin_data:
                ActionStreams:
                    rebuild_for_action_stream_events: 1
            preferences:
                allow_anon_comments: 1

Preference Items

  • allow_anon_comments; Allow anonymous comments. Boolean value.
  • allow_comment_html; Allow HTML in comment submissions. Boolean value.
  • allow_commenter_regist; Allow commenter registration. Boolean value.
  • allow_comments_default; Controls whether or not comments will be turned on or off for each new post by default. Boolean value.
  • allow_pings; Allow incoming trackbacks. Boolean value.
  • allow_pings_default; Controls whether or not trackbacks will be turned on or off for each new post by default. Boolean value.
  • allow_reg_comments; Controls whether or not registered users can post comments.
  • allow_unreg_comments; Controls whether or not unregistered users can post comments.
  • archive_type_preferred; Controls the type of archive that will be used for pointing to individual posts. Possible values:
    • Individual (individual entry archive)
    • Author (or Author Daily/Monthly/Yearly)
    • Category (or Category Daily/Monthly/Yearly)
    • Daily
    • Monthly
    • Yearly
  • autodiscover_links; Controls whether or not Melody will attempt to discover trackback URLS for each link in a new post when one is saved. Boolean value. Generally best to turn this feature off for performance reasons.
  • autolink_urls; Controls whether or not Melody will attempt to wrap URLs in a link tag if they do not have one around them already. Boolean value.
  • basename_limit; Controls the length of the basename field. For example, if set to "5," a new post named "Hello World" will have a base name of "hello" and that will form the basis of its URL. Integer value.
  • captcha_provider; Controls the captcha provider. String.
  • cc_license. String.
  • commenter_authenticators; A comma-delimited string of comment authenticators. At a minimum, should be set to 'MovableType' to enable the built-in commenter authentication. String.
  • convert_paras; The text format filter that will be used. Bundled formatters include:
    • Convert Line Breaks (for raw HTML editing)
    • Markdown
    • Markdown with Smartypants
    • Rich Text
  • convert_params_comments; Controls whether or not the selected text filter will be applied to comment paragraphs. Boolean value.
  • custom_dynamic_templates.
  • days_on_index; Controls how long an entry can stay on the main index. Set it to 0 to turn it off. Integer value.
  • email_new_comments; Controls whether or not an email will be sent to the Melody admin alerting them about a new comment. Boolean value.
  • email_new _pings; Controls whether or not an email will be sent to the Melody admin alerting them about a new trackback. Boolean value.
  • entries_on_index; Controls how many entries will be loaded onto the main index by default. Integer value.
  • file_extension; Controls the default file extension for individual, page and listing archives.
  • follow_auth_links;
  • image_default_align; Controls which direction to which an image will be aligned by default once it is inserted into a post. String value. Accepted values:
    • left
    • none
    • right
  • image_default_constrain.
  • image_default_thumb; Controls whether or not a thumbnail will be created by default. Boolean value;
  • image_default_width; Controls the default size of a thumbnail; Integer value.
  • include_cache; Controls whether or not template module caching will be enabled by default. Boolean value.
  • include_system.
  • internal_autodiscovery: Controls whether or not Melody will send trackbacks to other posts on your blog that you link to in a post. Boolean value.
  • is_dynamic; Controls whether or not the blog will be configured as a completely dynamically published blog or not. Boolean value.
  • junk_folder_expiry; Controls how long a comment or trackback will stay in the junk folder before getting purged. Integer value.
  • junk_score_threshold: Controls how low the junk score for a comment or trackback must be before it gets labeled as spam. Integer value.
  • manual_approve_commenters; Controls whether or not all comments must be manually approved before they get posted. Boolean value.
  • moderate_pings; Controls whether or not all trackbacks must be manually approved before they get posted. Boolean value.
  • moderate_unreg_comments; Controls whether or not all comments by unregistered users must be manually approved before they get posted. Boolean value.
  • nofollow_urls.
  • ping_others: A comma delimited list of URLs to ping when a new entry is posted. http://rpc.pingomatic.com is a typical default value. String value.
  • require_comment_emails; Controls whether or not commenters must supply an email address before they can post. Boolean value.
  • require_typekey_emails; Controls whether or not TypeKey users must supply an email address before they can post. Boolean value.
  • sort_order_comments; Controls the order in which comments are listed. Acceptable values are:
    • ascend
    • descend
  • sort_order_posts; Controls the order in which posts are listed. Acceptable values are:
    • ascend
    • descend
  • status_default; The default publication status for a post. Integer value. Acceptable values are:
    • 1 - Unpublished
    • 2 - Published
    • 4 - Scheduled for later publication
  • use_comment_confirmation; Controls whether or not commenters will be shown a confirmation page after they post a comment. Boolean value.
  • words_in_excerpt; Controls the default size of an excerpt (the behavior of the Excerpt tag). Integer value.

Continue Reading

 

Category: Guide

Tags: theme design


Questions, comments, can't find something? Let us know at our community outpost on Get Satisfaction.

Credits

  • Author: Mike Thomsen
  • Edited by: Violet Bliss Dietz
Clone this wiki locally