Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-08-13 11:25:54

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Textpattern Plugin Template

See Plugin Template entry in TextBook.

Last edited by Mary (2007-03-07 00:57:17)


Alex

Offline

#2 2005-08-16 00:58:00

graumeister
Plugin Author
From: Ban Bang Por, Samui, Thailand
Registered: 2005-01-16
Posts: 167
Website

Re: Textpattern Plugin Template

hi, it seems that with 0.4 the helptext is messed up. is this a problem within txp or a problem with the zem_tpl.php? (eg. http://grauhirn.org/files/gho_alternation.1.0.txt)

Last edited by graumeister (2005-08-16 00:58:30)


Samui? Samui! (about the life as farang in thailand)
David’s Neighbour

Offline

#3 2005-08-16 01:11:06

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Textpattern Plugin Template

It’s not messed up, it’s just not textiled. Did you copy ClassTextile.php into the same directory? Or otherwise changed the path accordingly?

Offline

#4 2005-08-16 05:20:25

graumeister
Plugin Author
From: Ban Bang Por, Samui, Thailand
Registered: 2005-01-16
Posts: 167
Website

Re: Textpattern Plugin Template

ah. sorry. my fault. right ;) i moved the files. thanks!


Samui? Samui! (about the life as farang in thailand)
David’s Neighbour

Offline

#5 2005-08-17 00:08:19

alice_c
Plugin Author
From: Karlsruhe, Germany
Registered: 2004-07-03
Posts: 33

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).

Thanks :)

Offline

#6 2005-08-17 00:57:44

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

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.


Alex

Offline

#7 2005-08-18 14:50:49

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

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.


And then my dog ate my badger, and the love was lost.

Offline

#8 2005-08-30 07:04:56

danboe
New Member
From: Seattle, WA
Registered: 2005-05-14
Posts: 6
Website

Re: Textpattern Plugin Template

I’m brand new to PHP, but I’m learning :) I followed the steps here, but I can’t download the plugin template and examples (thresholdstate site appears to be down, getting connection refused).

Thanks, I look forward to getting my first plugin in place.

Last edited by danboe (2005-09-02 21:44:13)

Offline

#9 2005-08-30 13:45:55

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

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.


And then my dog ate my badger, and the love was lost.

Offline

#10 2005-08-30 17:58:38

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

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.

Offline

#11 2005-08-30 18:34:58

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

Re: Textpattern Plugin Template

@Manfre – completely missed the Install link in the plugin help…all 4 times I installed this. Sorry to have misspoken. It does indeed work in version 4. My most humble apologies.


And then my dog ate my badger, and the love was lost.

Offline

#12 2005-08-31 00:00:13

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Textpattern Plugin Template

The download link is working now. It might’ve been down briefly during the server move.

Please don’t post general plugin development questions in this thread, start a new one instead.


Alex

Offline

Board footer

Powered by FluxBB