[development] CCK in Drupal 6
dopry at thing.net
Wed Feb 7 18:19:05 UTC 2007
On Wed, 2007-02-07 at 10:36 +0100, Bèr Kessels wrote:
> Nice post. And not very different from my future plans with flexinode, in
> fact. :)
> Op dinsdag 6 februari 2007 13:47, schreef adrian rossouw:
> > CCK exists of the following things for me :
> > 1. Field Types
> > 2. widgets and formatters
> > 3. Data model - consisting of the field types.
> > 4. Query builder - crud functions. - generates query from data model.
> > 5. Configuration interface - builds data model
> However, one thing I /really/ miss in the architecture of CCK, and in FAPI,
> and in your post too, is he view (as in theme/display) layer.
> We agree that data != presentation, right?
> We render "Submitted by Bèr Kessels on Sat, 02/03/2007 - 13:34." and not
> "Submitted by 12 on 1172793600"
> Data is 12, the uid. But what we display is the user name (or whatever we
> craft from it) with a link.
> I think having this is crucial, and in the ERD for flexinode I have called it
> the 'display profiles'. In both the FAPI and CCK this is spagettied trough
> the code. Some parts in the output are coupled to the widget (!?) in the form
> of config settings. Others are left to the type of widget. Again others are
> left entirely to the theme. The lack of vision and therefore consistency
> bothers me, as a themer. We should IMO at least *think* about how and where
> to handle this.
What are you talking about Ber? Have you even used CCK lately? The
Formatter system has been in place for quite a while now, and is working
really well. It even allows you to specify the formatter you want to use
for a particular field in views, and you can use the content_format()
function in your themes as well. You can easily write additional
formatters for any field type in your own custom module.
> In any case: Flexinode will, at some point, use display profiles. How exactly
> they are going to be coded: I have no idea. But what they *are* is clear to
> A simple configurable, database stored 'thingy' that tells what theme function
> (callback handler id) should be called to render the data.
> $node->date is the data. The display profile tells "because of Foo and Bar,
> use 'theme_date_ago()' with arguments array('uid'=>$node->date)".
Already done. See the display settings patch that eaton wrote that is
now a part of cck. It allows you to select the formatter used in
different display contexts and will expand to support RSS, print, etc.
More information about the development