Fork me on GitHub

editing properties

An article by Gaspard Bucher

Forms let you edit properties of a node.

For example, if you need to set a list of languages your friends speak, you may have added a property called speaks to the Contact node class.

To provide a way for editing that property, you may use r:form to let the Contact.zafu template render a form:

<r:form>
  <r:input label='true' name='speaks'/>
  <r:input type='submit'/>
</r:form>

Now, users with write permissions will be able to change the property.

For more advanced stuff see HTML Forms with Zena.

Of course a better idea to model spoken languages would be to create a virtual class named “SpokenLanguage” and create links between “Friends” and “SpokenLanguages”. With the new ‘status’ field on links (see relations), you could even say if they speak it well or not.

By default, properties are versioned as you can see in the diagram below, and a change creates a new version when the last version of the node is more than 2 hours old.

tables

Main zena tables.