Registering Your Plugin: Basic Plugin Metadata
You now know what a plugin is, you know what the registry is and you know the basic syntax of YAML. It is time for you to write your first plugin. So, without further ado:
Create a directory called
/path/to/mt/plugins/HelloWorld
In that directory create a file called
config.yaml
and open it in a text editorAdd the following text to your
config.yaml
file:name: Good for Nothing Plugin for Movable Type id: Good4Nothing author_link: http://www.yourwebsite.com/ author_name: Your Name Here description: This plugin is an example plugin for Movable Type. version: 1.0
To see your new plugin, login to Movable Type and navigate to: System Overview > Plugins. You should see “Good for Nothing Plugin for Movable Type” listed there.
Congratulations, you just wrote your first Movable Type plugin, and you didn’t even have to write any code! Wow. Yeah, I knew you would be impressed.
So what does this plugin do?
Good question. It does absolutely nothing, just as the name implies. But let’s review what you just did.
The above config.yaml
file told Movable Type the basics of what it needed to know about your plugin to list it properly among other plugins in your installation. Here is a brief overview of the registry keys used above, as well as some additional keys you might be interested in using:
- name - The display name of the plugin.
- id - A unique identifier for this plugin used when looking up this plugin’s data in the registry. It is also used when referring to handlers within the plugin (optional - when left unspecified, the plugin’s directory name will be used).
- key - The string used by Movable Type when storing and retrieving stored via
MT::PluginData
(optional - when left unspecified, the plugin’s ID will be used). - author_link - The URL to the primary author.
- author_name - The name of author or authors.
- description - A brief one or two sentence of what this plugin actually does.
- version - The current version of the plugin.
- plugin_link - The URL to the plugin’s homepage.
- doc_link - The URL to the plugin’s documentation.
But who wants a plugin that does nothing? Time now to wade a little deeper into the pool.