Quote from: dragonlord at Jun 03, 2007, 04:36 AM
- TV should be could addet to pages and NOT to templates
(So every page can have their own TV’s)
1.0 will introduce the concept of Resource Elements, or elements of content (e.g. chunks, TV’s, snippets, etc.) that are directly tied to a particular Web Resource (or document in current MODx terms). At that point, the main content of each Resource would become just another TV element. This change is being reserved for 1.0 release to preserve an upgrade path to 0.9.7 for user who have written components that are dependent on the current data structures, which will be significantly affected.
Quote from: dragonlord at Jun 03, 2007, 04:36 AM
- Easy access to TV via code. Something like
GetTVvalue and SetTVValue
(So you can realize GuestBooks, Polls and stuff like that without any foreign snippet)
0.9.7’s new object-oriented API will address this. Consider a simple snippet to change the value of a TV for a specific Resource (a.k.a. Document)...
$tv= $modx->getObject('modTemplateVar', array('name' => 'category'));
if ($tv) {
$currentCategory= $tv->getValue($modx->resourceIdentifier);
$tv->setValue($modx->resourceIdentifier, 'New category');
$tv->save();
}
return $tv->renderOutput($modx->resourceIdentifier);
Quote from: sottwell at Jun 03, 2007, 01:23 PM
I would like to see categories for documents, that way you could assign templates and TVs and all sorts of stuff by category, which would make document management much easier.
@sottwell: In 1.0, with Resource Elements, you will be able to attach an Element directly to a Resource (a.k.a. Document) that would indicate a
category, in exactly the same way the expected default
content Resource Element would provide the current document content (housed in the site_content table), or not. In addition, by grouping and nesting Elements in a tree hierarchy, much like the current document tree, you would be able to quickly and easily attach a single or complete sets of related Elements directly to Resources, or to Templates as you would with Template Variables. Does that make sense?
In other words, consider you have a set of TV-like Elements you wanted to attach to Resources within a specific folder/container. You could define a parent Element for no other purpose than grouping these together, define the actual Elements to hold the content as children of this parent, then attach the parent Element to a Resource (via the concept of Resource Elements), or to another parent Element (i.e. a Template), or some combination of the two.