Help - Search - Members - Calendar
Full Version: Techincal Plugin Docs?
Movable Type Community Forum > Additional Resources > Plugin Development and Usage
guice
Where can I locate online docs for makeing Plug-ins? The small manual example is nice and all, but it really doesn't tell ya jack about making them.

I'm looking more for a online POD layout of all the objects and methods avaliable. Including public valiarable, if there are any, etc etc.

Anything like that exist?
btrott
Well, the methods listed in the manual are the methods available for creating new tags. If you're talking about other objects and methods in the system, check out the POD documentation in the .pm files. For example, type this at the shell prompt:

CODE
perldoc lib/MT/Entry.pm


to see the MT::Entry documentation.
guice
aye, perldoc along with pod2html.

I was wondering if there's already any online HTML perldocs for viewing? Having only a telnet prompt to a server in US while being almost 12 hours away on a 56k modem, tends to create a slow command line browsing environment.  ;)

Would be nice to have already made techinal documentation online for viewing.
guice
Well, I've went ahead and slowly converted everything to HTML, one by one, and ran into an example of what I'm really after:

package MT::Template::Context;

This package doesn't have any docs to it, however; it's talked about in the Plugin Readmes in the Manual. Do I have a bad copy?

Looking at your example codes and the plugin I've recently seen posted in here, it uses $c->stash a few times.

I've found that stash it a method within MT::Template::Context and MT::Request, but I don't see any perldoc on this.
Am I missing something?

I'm looking for something a bit more than "Here's how to make a plugin - do this". But a "To make a plugin, you'll need to use wo methods located within MT::Template::Context, add_tag and add_container. add_tag takes .... and returns ... and is of object ... " etc etc. A bit of a Techinal discription on how it breaks down.
Also stuff like - When calling your sub, MT passes in X(?) items .. etc.
Would be helpful, since using my old standard, use Data::Dumper; print Dumper ( \@_ ); won't work all to well. Atleast I would assume it wouldn't due to interfaces.

I had no clue that the method required a single hash value pair; name => sub {} ( or Sub Reference ). That wasn't stated in any docs. I found that out when MT choked on an attempt to create a static variable (ie path). oops.
MT didn't like ( myPath => '/home/place/here' );

I'm still not 100% clear on it's parameters too. What gets passed to it? And how does MT or I process it correctly?

sure $tag = $_[0]->stash('tag");
but what the heck $tag equal? What does stash return? Stash takes on parameter of $key, and does a shit on @_ sticking it into $ctx->{__stash}->{$key} .. ?

Provide more detail? I'm just trying to get a grasp on this, and not being at home, with my nice printer and virtually unlimited supply of paper/toner, I'm a bit sol.

Yet again, a big long post. But I hope you see what I'm really asking for. More detail really.
add_tag/container - it requires X parameters. It can or can not take X (array reference to multiple tags at once?).
when MT calls your method, it passes in X items. etc ...
Additional tools can be found in MT::Utils, consult the pod docs for details of them.
Context has sash and X other methods you might find useful, they do X. Require X parameters and return X object(s).

Oh, and don't worry about talking over my head. I have a good grasp on Perl and should be able to desipher much of anything you throw at me.  :D
btrott
Okay, I'll add some docs for the methods in MT::Template::Context.

stash is basically just a storage container--you set something in the stash like this:

CODE
$ctx->stash('foo', $whatever);


$whatever can be any scalar value (a reference, a string, a number, an object, etc)

You then get that value back out like

CODE
$whatever = $ctx->stash('foo');
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.