Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#373 2009-04-22 18:22:37

bmsorg
New Member
Registered: 2009-02-25
Posts: 7

Re: [plugin] [ORPHAN] sed_section_fields

I’ve noticed that some people have issues with sed_section_feilds (even with wet’s adjustments) and glz_custom_fields-1.2 (v1.2 along with gerhards 4.0.8 branch) working together on 4.0.8. I just realized that it seemed like it worked for me, because I installed sed_sf first, then glz_custom_fields. Everything seemed to be working together well, but then when I emptied the cache on my browser, I realized it in fact wasn’t really working (sed_sf no longer worked). Not sure what the consensus is with these two plugins working together but I’ve noticed a lot of people trying, so I thought I’d share this.

Offline

#374 2009-04-22 19:16:43

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: [plugin] [ORPHAN] sed_section_fields

mrdale wrote:

Can you break that down a bit? I mean a pluggable write page UI looks great, but can you be just a wee bit more specific?

A plugin author can now override/extend, among others:

  • the user interface for the definition of custom fields, for instance to change the default INPUT element into a complex form to build her data dictionary.
  • the user interface for the entry of custom fields values in the write tab, again with all imaginable custom entry handlers.
  • the user interface for each entry in the section tab, for instance to add additional fields or hook JS into a single section entry.

These capabilities were all available in previous versions of Textpattern CMS, understood. But now a plugin author doesn’t have to wade through volatile HTML markup but rather hook into a well defined and (hopefully) stable API. At least this is the intention of all those scattered pluggable_ui() hooks.

Offline

#375 2009-04-27 13:21:39

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

Re: [plugin] [ORPHAN] sed_section_fields

Robert, I’m going to take a closer look at those _ui functions, try to put them to good use rather than hard-hacking parts that could have been addressed differently- from what you’re writing. Because those functions are scattered throughout TXP, which would be the best place to start? Cheers.

Offline

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

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website 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: 11,271
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.

Txp Builders – finely-crafted code, design and Txp

Offline

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

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website 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: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website 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

Board footer

Powered by FluxBB