Textpattern Forum

You are not logged in. Register | Login | Help

#1 2011-03-15 16:33:38

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 759
Website

[request] Dreaming Aloud - Data Template Plugin

What if. . . .

  • What if we could create all types of custom fields, like glz, but freed from the write tab?
  • What if we had a plugin that could create a new tab?
  • What if that tab could be assigned to any top level tab, including the new “home” tab?
  • What if we could put only the data fields we wanted on that tab? No more, no less. No more hiding fields – unless we want to.

Think of this as glz_custom_fields, bot_cf_names, and bot_wtc rolled together and put on steroids.

Background

I think it is safe to say that there is a general consensus that one of Txp’s great features is custom fields. There are a multitude of plugins whose job is to create additional database fields in one flavor or another — glz_custom_fields for the write tab, smd_bio (as well as a couple of others) for the user/authors tab, ign_users for an alternate user databse, smd_tags, tru_tags, and rss_unlimited_categories, just to name a few.

As of Textpattern 4.2.0 the ability to extend custom fields was enhanced. A few plugins have come out or been updated to leverage that.

I’m wondering if it can be taken further. A custom field plugin to rule them all . . . . ;-P

The inspiration

It is not unusual to run into a post on the forum hoping for, dreaming of, or asking for speciality custom fields. Custom fields for images, links, files, and most recently, sections. Sometimes there’s even a request for a plugin to add a whole new tab for specific content like videos or otherwise create entirely custom interfaces.

There is a CMS called Symphony that has some of the feeling of Txp, but lacks the polish of Txp, and is much more challenging to get your head around . . . or at least it has been for me. :)

They have a couple of ideas that I think are worth borrowing. One is what I’m going to call Data Templates. That’s what I’m wondering if we could create a plugin around.

glz_cf is great, but only for the write tab at this point. bot_wtc is unbelievable useful, but you still have lots of fields that are being hidden or lots of javascript potentially slowing the page down.

The Proposed Solution

This plugin would:

  • Create a tab under the Extensions Tab (makes sense, because in adding data fields, you are literally “extending” Txp.
  • This tab would be a “data template” editor.
  • You could select an existing tab from a drop down menu to edit (e.g. customize) or create a new tab
  • You could set a preference for where the tab would reside (Become its own Top Level tab, or be under Home, Presentation, Content, Admin, or Extensions).
  • You would have a preference to set that would show/hide tabs. An interesting twist would be to relate the show/hide to user permission level.
  • You could use pre-existing data fields (including Title, Body, Key Words, etc. — perhaps using a multi-select?) or create new custom data fields
  • You could set relationships between fields (1 to 1, 1 to Many)
  • You could associate each tab with sections (re-creating the effect of bot_wtc’s hide by section feature)
  • You could associate with categories (???)
  • Existing tags would continue to work as expected with existing fields
  • New fields could be accessed using the txp:custom_field
  • Alternately, other plugins could add tags (example: smd_bio fields could be added to a template, and smd_bio tags used for output).
  • You could could assign a custom name to each custom data field
  • You could assign css selectors to each data field
  • The editor would create a css stylesheet unique to that tab and save under Presentation -> CSS and/or to a Textpattern/CSS directory
  • The editor would insert an @import in the head of the tab for it’s unique css style sheet
  • A “data template” and its css style sheet could be exported or imported, so we could share them like plugins, themes, and website templates.

It seems like we can pretty much do most of these things already – but it requires a number of plugins, hacks, customizations, etc. This plugin would simplify everything and create a single interface.

But, the first question needs to be: Is such a plugin possible with Textpattern? How close could we get? Second – Is there be enough interest in something like this to make it happen?

Okay – I’ll throw this out there for thoughts, critique, etc.

Last edited by maverick (2011-03-15 17:12:42)

Offline

#2 2011-03-15 19:34:23

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: [request] Dreaming Aloud - Data Template Plugin

Symphony CMS is impressive — powerful, elegant, and as extensible as a CMS could well be, in terms of content management. (Of course you have to learn XSLT to use it, the initial learning curve for the system itself is quite steep, and out of the box there is quite a bit of work to do to set up the framework for a custom site. But I digress.) I haven’t looked into it closely enough to really understand what’s going on behind the scenes, w/r/t database schema etc.

For another approach to extending content types, see Escher. The 0.9.0 release allows custom metadata and custom content fields for the Page content type, and the latest development version allows custom metadata fields for all content types. So, not as wide open as Symphony CMS, but very extensible.

Txp 5 will represent, at least, a move in the direction of this kind of extensibility. How much remains to be seen, but suffice it to say the days of never having to use JOIN in a Txp query are coming to an end.


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#3 2011-03-15 19:47:24

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 564
Website

Re: [request] Dreaming Aloud - Data Template Plugin

Symphony CMS is impressive

See also ProcessWire — I prefer it over Symphony so far, as it feels very easy to set up in comparison.

In fact, I’m using ProcessWire right now when I need features like those that Mike mentioned.

Last edited by maruchan (2011-03-15 19:47:46)

Offline

#4 2011-03-15 21:56:43

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 918
Website

Re: [request] Dreaming Aloud - Data Template Plugin

Hi Mike,

I agree with your dreaming – the process of shoe-horning data fields into articles is not ideal. I’ve had this requirement in the past but haven’t worked out the best way of achieving it. Separate database tables are great but they’re invisible to the standard search functionality – and you can’t use TXP tags to access the data. Custom fields can be given meaningful names but really they need to be viewed in a table. The closest I could come to an idea was to have a Multi-Article Write tab which displayed a number of articles’ custom fields in a table – so the user could see & edit all the data fields in one go.

Adi

Last edited by gomedia (2011-03-15 22:04:43)

Offline

#5 2011-04-15 07:13:06

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 918
Website

Re: [request] Dreaming Aloud - Data Template Plugin

adi_matrix may help to take things a little further forward …

Offline

#6 2011-04-15 18:26:08

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,066
Website

Re: [request] Dreaming Aloud - Data Template Plugin

smells like xPattern ;)

Offline

Board footer

Powered by FluxBB