1. Tuesday, July 01 2008 02:58remote update

    Just a small note to tell you about some small (but nice) enhancements for which I have spent two days rewriting parts related to html DOM ids.

    remote update

    We can now use <r:link/> to update any <r:block/> on the page. This can be interesting to preview a node without leaving the page’s context. Just use update='dom_id' in the link tag where dom_id is the id of the block to update (see block for an example).

    Another way to update a node is to use drag and drop: drop a node on a special drop block and voilà (see drop example).

    comment pseudo attributes

    It can be interesting to log changes on nodes. To do so, simply add ‘m_title’ and ‘m_text’ hidden input fields in the form. These attributes are write-only.

    “copy” and attributes

    Sometimes, it is interesting to create a new node by copying (parts) of another node. Simply use the copy pseudo attribute and insert attributes in brackets in the (hidden) input fields:

    <r:form>
      <r:input type='hidden' name='v_text' value='[v_text] copy'/>
      <r:input type='hidden' name='copy_id' value='45'/>
    </r:form>

    This can also be used in the new, enhanced drop element:

    <r:drop v_title='[v_title] copy' id='[id]'>...</r:drop>

    All attributes in “drop” are translated into field values set on the dropped element. These values can be relation ids, dynamic attributes, parent_id, comment pseudo attributes, anything. If you feel you would prefer to change the receiver simply say so with change='receiver'.

    Gaspard Bucher

    comments

    1. leave a comment