Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#376 2009-04-28 09:51:09

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,422
Website GitHub Mastodon

Re: [plugin] [ORPHAN] sed_section_fields

Preface: pluggable_ui() broadcasts events as Textpattern core renders various parts of the user interface, and works in companion with plugin(s) which listen to the particular event (and optionally step) via register_callback(). Anything which is returned by the participating plugins is interwoven with the native markup and echoed to the client. In most instances, the plugins can completely override the built-in markup, while in a few instances the plugins’ markup is added to the built-in.

From what I’ve seen, this particular plugin modifies the section listing and the write screen.

So as a start, dig into include/txp_section.php and make note of the events the core sends to acquire any custom extensions to the default section list presentation: pluggable_ui(‘section_ui’, ‘extend_detail_form’, ‘’, $a) looks promising. NB: $a keeps the current section data and is passed into your event handler as a third parameter.

Likewise, find a place in the write screen where the core renders the custom field entry form, and hook into the “article_ui”, “custom_fields” event as well:

register_callback('foo_my_custom_fields', 'article_ui', 'custom_fields');
// [...]
function foo_my_custom_fields($event, $step, $thisarticle='')
{
	return 'look, ma! no custom fields any longer!';
}

I think using some real code would serve best as a starting ground, and as I’ve just released wet_native, a plugin which mingles with user management from the admin tab by interfacing with the new core functionality I’d suggest to skim over its source.

Offline

#377 2009-04-28 12:49:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,498
Website GitHub

Re: [plugin] [ORPHAN] sed_section_fields

wet wrote:

$a keeps the current section data and is passed into your event handler as a third parameter.

Aha! So that’s what it’s for. Thanks for clearing that mystery up.

OT: Might be time to extend the plugin dev guidelines :-) to include some of the “API” (for want of a better word) features and callbacks in the core. I don’t mind doing it if you want to put a skeleton up there and point out a few things that us mortals might not know about; the above being a prime example.

btw, pluggable_ui() rocks! I’ve been tinkering with it the past few days. I’ve also used some of the plugin lifecycle management system in the upcmoing ied_plugin_composer. Very handy for auto-initializing prefs and making sure the plugin tidies up after itself.

Last edited by Bloke (2009-04-28 12:49:34)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#378 2009-04-30 11:12:41

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,422
Website GitHub Mastodon

Re: [plugin] [ORPHAN] sed_section_fields

Heads up: At Gocom’s suggestion, I’ve changed the signature of callback functions for pluggable_ui(). You knew this wasn’t stable yet, didn’t you?

Offline

#379 2009-04-30 11:21:48

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [plugin] [ORPHAN] sed_section_fields

wet wrote:

Heads up: At Gocom’s suggestion, I’ve changed the signature of callback functions for pluggable_ui(). You knew this wasn’t stable yet, didn’t you?

Who? Me? Where? Waaa… :D Wet, you prolly mean gomedia, or that is atleast where the link leads. Nice feature it is, even that i didn’t request it… or did I ;)

Offline

#380 2009-04-30 11:24:32

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,422
Website GitHub Mastodon

Re: [plugin] [ORPHAN] sed_section_fields

Gocom wrote:

Who? Me? Where? Waaa…

Umm, my bad.

Offline

#381 2009-05-13 18:15:04

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [plugin] [ORPHAN] sed_section_fields

All

Anyone care to try my update for 4.08? http://gist.github.com/111177

Let me know how it goes for you, especially if you are running Gerhard’s version of Txp4.08 and his custom field plugin (which I’m not.)


Steve

Offline

#382 2009-05-13 18:23:18

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] sed_section_fields

Should we remove the [ORPHAN] part in the thread’s title? :) Good to see you around, Steve!

Offline

#383 2009-05-13 18:33:37

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [plugin] [ORPHAN] sed_section_fields

Els wrote:

Should we remove the [ORPHAN] part in the thread’s title? :) Good to see you around, Steve!

Nice to be back; but don’t think about removing it just yet … I can fix this one as I need it for a Txp site I’m doing now but the same can’t be said of my other stuff, especially the MLP pack.

Wet, Ruud

Txp 4.09 feature list shaping up to be just awesome!


Steve

Offline

#384 2009-05-13 19:49:20

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: [plugin] [ORPHAN] sed_section_fields

Delete the [ORPHAN] it works great, with Gerhard’s version of Txp4.08 and his custom field plugin!
Thanks for this update!!

Offline

#385 2009-05-13 19:59:36

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [plugin] [ORPHAN] sed_section_fields

mlarino wrote:

Delete the [ORPHAN] it works great, with Gerhard’s version of Txp4.08 and his custom field plugin!
Thanks for this update!!

Great news. Still need some confirmation from others … and folks using 4.07 or 4.06 sites too (if possible).


Steve

Offline

#386 2009-05-13 20:58:36

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [plugin] [ORPHAN] sed_section_fields

Welcome back Steve! You make awesome software.

I’m Still looking forward to a stock-installable combination of glz_custom_fields + sed_section_fields now the necessary hooks have made their way into recent dev versions of the core.

Gerhard was talking about rolling sed functions into his plugin. Perhaps you guys should discuss the status and future of these two vital and very-related plugins.

Offline

#387 2009-05-13 21:10:31

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [plugin] [ORPHAN] sed_section_fields

Dale

Hello. It would be great if Gerhard chooses to roll the two together, especially with the changes in 4.09 which look fantastic. For now though, I’d be happy to know if the version I posted here works for you.


Steve

Offline

#388 2009-05-13 21:39:23

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] sed_section_fields

Welcome back!
It works well in 4.0.8 (without glz…)

Offline

#389 2009-05-13 23:56:48

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: [plugin] [ORPHAN] sed_section_fields

Nice to see you around Steve! I will have to start looking at 4.0.9 and coding glz_custom_fields in such a way that it doesn’t require a patched TXP version. With Robert’s changes to max_custom_fields, this could really happen.

I’ll also look at how to best include your plugin’s functionality into glz_custom_fields. Even though having a lib plugin isn’t something I’m keen on, merging those 2 plugins together will leave me with little choice. I’m wondering whether using a factory class would cut it. How many people are still running TXP on PHP4 btw?

Offline

#390 2009-05-13 23:57:34

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: [plugin] [ORPHAN] sed_section_fields

saccade wrote:

Welcome back!
It works well in 4.0.8 (without glz…)

Are there any problems with sed_section_fields and glz_custom_fields v1.2?

Offline

Board footer

Powered by FluxBB