edit

An article by Gaspard Bucher

Add a link to edit the current element inline.

  1. action
  2. ajax
    1. add
    2. ajax?
    3. block
    4. cancel
    5. drop
    6. edit
    7. js
    8. start_node
    9. swap
    10. toggle
  3. API
  4. classes
  5. common attributes
  6. conditions
  7. context
  8. dates
  9. display
  10. forms
  11. i18n
  12. meta
  13. SQLiss
  14. urls

Add a link to edit the current element inline.

  • publish Set whether to auto-publish node after save.
  • cancel Cancel text when shown in a form.
  • tcancel Translated cancel text.
see cancel, each, form, publish, unknown

If there exists a form in the current list context or block, the form is used for editing. Otherwise, the form is built from the attributes being shown in the ‘each’ method or in the ‘block’.

edit without a form

<ul do='notes'>
  <li do='each'>
    <r:link/> <r:edit>change name</r:edit>
  </li>
</ul>

If you only need to edit a single attribute, like in the first example above it is easier to use the “edit=’true’” syntax of the show method.

edit with a form

<div do='block'>
  <p class='edit' do='edit'/>
  <p class='husband' do='husband.title'/>
  <p do='form'>
    <label>Select your husband</label>
    <r:select name='husband_id' nodes='guys where nice = "true" in site'/>
    <p><r:cancel t='no way!'/><r:input type='submit'/></p>
  </p>
</div>

You can use the “cancel” tag inside a “form” to show the “cancel” link.