Quote from: PaulGregory at Aug 06, 2006, 06:41 PM
...it sounds like I’d be able to have an American advert and a British advert as cultural variants of the same chunk.
Absolutely.
Quote from: PaulGregory at Aug 06, 2006, 06:41 PM
I guess that any chunk editor I release will be redundant in 1.0 - I assume that future front-end editors packaged with MODx will be able to edit *any* kind of Element, and/or change which revision is the live published one. I really like this idea btw, I guess it would also give us somewhere to ajax-autosave ’draft’ versions as they are being edited. I assume you can only edit the most recent version OR create a new version based on an older version, otherwise it would get unwieldy.
Unwieldy indeed. At some point, maybe I can find/write an efficient diff processor in PHP so we could save just the differences, a la SVN, but I think I have enough on the current roadmap to worry about it...
;)
Quote from: PaulGregory at Aug 06, 2006, 06:41 PM
I can see that content elements can be defined. Great, but is this how I distinguish between (and group) content types, even when there is no technical difference?
Imagine I have a site that has a bunch of advert chunks and some other text chunks (like a "thank you" message for form submission). Is there any plan in 1.0 for categorising these elements or am I supposed to define them as distinct element types?
Reasons I would like to group chunks include access control, workflow and comprehendability.
Categorization is multi-faceted moving forward. First, you’ll be able to use categories, with a hierarchy; the current category table is only suitable to model a flat, single level set of categories, but simply add a parent reference and we have the capability to define a tree structure of elements to organize them more granularly. Second, since elements can reference other elements using a `guid` and `parent_guid` column (a unique identifier assigned all Elements, and unrelated to the primary key column, which can also help make the elements, and their relationships more portable from deployment to deployment), they can further be organized in this more direct way. For instance, consider a ScriptElement (i.e. snippet) that defines several child elements to serve as templates to be used and referenced in that ScriptElement’s content, be they of the simple Element class (i.e. Chunk), a more advanced ContentElement (i.e. next-gen TV), or another ScriptElement (i.e. snippet). You would be able to have any kind of related Element listed on a related elements view in the manager or a front-end editing plugin.
Combine these two and you have a pretty powerful set of tools with which to organize and customize your manager and/or front-end interfaces.
Oh, and workflow will also be possible via two additional features. Custom metadata (did I mention the MetaElement class before, oops) can be one of those related element types, and any ScriptElement class (or custom Element classes) can stop the propagation of further processing of related elements in a specified order of execution. In this way you can chain a set of scripts to execute based on decisions made in the one before.
Quote from: PaulGregory at Aug 06, 2006, 06:41 PM
Presently there’s no distinction between being able to edit snippets and being able to edit chunks - I guess this is part of the history. Is the long-term elements plan wrapped up in a better user access system?
Quote from: OpenGeek at Aug 06, 2006, 04:17 PMTV’s extend the basic Element a little, providing more advanced behaviors
Extend a little? Wow. I was thinking that TVElements would be associated with templates and documents and widgets - thus the method and value returned is defined by many things. Is that little as in the difference "0.0.5" makes? 
Whilst on the subject, I’d like to see "global TVs" in addition to "document TVs". There’s a lot of functionality in TVs that isn’t available to a chunk, and is not as easy to do as a snippet: it would be quite nice to have the logo for instance selectable *once* based on a selection of "normal logo", "logo with snow", "flaming logo" etc rather than per-page.
That’s just it, all Elements are global in this design. You can attach any of them to a Resource, which is the name of the class which represents anything accessible via a URI (web page, symbolic link, web service, ajax service, etc.), or to any other Element, of any Element class. And one Element serves as the root or base element for a Resource, i.e. this is your Template, only it can be of any Element class, not just a static HTML template.
Also, all Elements have properties, can define an InputClass, OutputClass (basically class-based versions of widgets, currently only available to TVs) and corresponding Input and Output properties, and you can also define pseudo-Elements, which do not have persistent data storage in the Element table. These are like Elements that are only processed in content as tags (thus, they extend the modTag class), and serve as the base implementation for processing...
- link tags, e.g. [[~49]] or [[~alias:myfancyportfolio]]
- placeholders, [[+myplaceholder]]
- configuration settings, [[++site_url]]
- @bindings, e.g. [[@INHERIT]]
- any thing else you can implement as a tag with an initial token string