Re: Textpattern Plugin Template

Alex, could you please extend your template for the parameter step? I need to use this, because my plugin will have more than one page in the admin-interface (like the list of articles and edit one of those).

Re: Textpattern Plugin Template

Alex, could you please extend your template for the parameter step?

I’m not sure what you mean. There’s nothing in the template that enables or restricts this.

Are you referring to the example code? If so, it’s intended merely as a trivial example. There are any number of things that could be included that aren’t. I’d suggest reading the source of some real plugins if you need in-depth examples.

Re: Textpattern Plugin Template

Just a note — and perhaps a separate topic for discussion — plugin developers should think long and hard about the structuring of tabs for admin plugins. The following came from an offlist discussion with andjules regarding some enhancements to my plugin he was testing:

I obviously can’t see what’s in store for ign_user_mgmt tab (error), but the ign_pass_protect prefs, well… it’s nothing that can’t be handled in the tag. anyone who’s technically ‘up’ for installing and using a plugin won’t really benefit much from this… the reason i bring it up is that if a bunch of plugin developers start adding extension tabs without some ‘less is more’ thinking, the extension subtabs are going to get out of control fast.
obviously, you are experimenting with the ability (and you’ve got it working!) to add tabs; I’d just say that some discussion between developers is in order, to come up with criteria for when it is appropriate to add a tab.

His point was well taken. Running at 1280×1024, I think the max number of tabs that’ll fit on the page is about 10; if you have 5 plugins that each generate 2 tabs, then you’re full up.

I still haven’t decided what to do with the Preferences1, but I did consolidate to a single tab, as splitting things to two tabs really didn’t make for a significantly improved user experience.

1 I know Manfre moved the preferences for his self-register plugin to the Preferences tab as opposed to adding a tab under extensions, though I don’t believe it’s working in TXP 4.0. Perhaps an additional option on the preferences tab for plugin preferences, with a dropdown to select the plugin? I’m not a huge fan of dropdowns, but that’d certainly address the issue of scalability. And this is a topic for another discussion.

Re: Textpattern Plugin Template

</code>
Try again to grab the template (I just hit thresholdstate just fine, so it’s not at the host end). If you’re still having problems, I’m sure someone could email you a copy (it’s quite small).

If you’re not using the template, then use single quotes around the code string, but you’ll also need to escape quotes within the code, which can be rather confusing even to seasoned coders (especially if your code includes escaped strings…).

Also, given that the plugin development presupposes a certain level of familiarity with PHP, it might not be the best place for getting your feet wet, so to speak. You can also include PHP code within pages or articles simply by replacing the typical PHP open/close tags ( <?php ?> ) with <txp:php> </txp:php> — that would probably be a better place to start.

Re: Textpattern Plugin Template

> igner wrote:

I know Manfre moved the preferences for his self-register plugin to the Preferences tab as opposed to adding a tab under extensions, though I don’t believe it’s working in TXP 4.0. Perhaps an additional option on the preferences tab for plugin preferences, with a dropdown to select the plugin? I’m not a huge fan of dropdowns, but that’d certainly address the issue of scalability. And this is a topic for another discussion.

This functionality works in 4.0, and with the self reg plugin. I think separating based upon plugins puts a restriction upon plugins that work together. For example, I created a moderation queue plugin. This plugin is meant to be used by other plugins as an abstract way of adding moderation support for any type of data. I have moderation extension plugins for articles, images, and links. All of these extension plugins group their preferences under “Moderation” in the advanced prefs page.