The built-in editors
What the interface's own editors do, in short, and what the model controls in them:
- Dates. A
datetimeis stored in UTC and shown in the editor's own time zone. Clearing it stores the unsetDateTime(0001-01-01), which shows as empty. - Files. A
filefield writes at once, not when the node is saved. An upload goes into the version the blade has open, and Remove takes the file out of that version only. A new node keeps the chosen file until its first save. A file in an inner node cannot be changed in the editor. - Rich text. An
htmlproperty has a rich text editor with a source view. It keeps paragraphs, headings, lists, quotes, code blocks, rules, line breaks, links and pictures. HTML with other markup, such as a table, a class or a style, opens as source, and the editor asks before it drops anything. Links and pictures are stored by node id, so they survive URL changes (Links in rich text). A picture pasted or dropped into the text is uploaded into one of the node's file properties, so the type needs one for that. - Passwords. A
passwordfield shows whether a password is set, and lets editors set a new one or remove it. It never shows the password.
A link or embedded field shows its nodes as Display on the property's attribute says. It is
Relatude.DB's DisplayMode, which a database can also change in the admin UI. Editors can switch a
field to another view in their own browser.
public interface IAuthor : IItem {
[RelationProperty(Display = DisplayMode.Table)]
AuthorArticles.Articles Articles { get; } // "many" end of a OneToMany<IAuthor, IArticle>
[ReferencesProperty(Display = DisplayMode.Cards)]
References<IArticle> Featured { get; set; }
[EmbeddedProperty(Display = DisplayMode.Inline)]
Embedded<SocialLink> Links { get; } // SocialLink: a class with a Guid Id
}Display |
Shows |
|---|---|
List (the default) |
a row per node, with its type's icon and its name |
Table |
rows with the node's name and a few short values |
Inline |
each node as a form that opens in place |
Cards |
a card per node: its picture, name, type and some text |
Thumbnail |
a tile per node: its picture, or its type's icon, and its name |
Pills |
a tag per node, with its name |
Dropdown |
a drop-down to choose the nodes from; not for embedded nodes |
Select opens the node picker on the referenced type, New makes a node and links it, and nodes
can be dragged onto the field. An Inline node is edited in place, and its changes are saved after
the node. The inner nodes of an embedded property open in a dialog, or in place with Inline, and
are saved with the node, the list as a whole.
When a node is saved elsewhere, open editors take the saved values into the fields they have not edited. An edited field keeps the edit, and offers Use saved when the saved value differs. A save writes only the fields edited in that blade, so it never writes an old value over someone else's. When others have the same node open, the blades edit it together, live: typing in text and HTML fields is merged, with everyone's cursors shown, and other values take the last change.
The editor edits one version of a node: the one in the blade's language, or one opened in its Revisions tab. That tab publishes, unpublishes and archives versions, and copies or moves them between languages. Publishing a version archives the one published before in its language.