unknown

Method run for all dynamic tags.

  • from (site,project,section)
  • author (stored,current,visitor,id)
  • project (stored,current,id)
  • updated ( date selection )
  • created ( date selection )
  • event ( date selection )
  • log ( date selection )
  • section (stored,current,id)
  • direction (both) get ‘references’ and ‘reference_for’ for example.
  • or other elements to include in the query
  • where pseudo sql filter
  • else specify an alternate relation if nothing is found
  • order specify order
  • paginate (pagination key)
see context, date selection, edit, else, link, node, pagination !
<r:parent do='[name]'/>
<r:children> ... </r:children>
<ul do='references' or='reference_for'> ... </ul>
<r:void store='foo'> ... <r:foo> back in 'foo' context</r:foo> </r:void>

<div do='images' from='project' order='random' limit='10'>
  <r:img mode='pv'/>
</div>
<ul do='pages' order='d_done DESC' do='each' join=', ' do='link'/>
<div do='notes from project where d_domain = fun' or='news where d_domain = fun'/>

pagination
<ul do='images' in='site' paginate='p'>
...
page count: <r:show var='p_count'/>
total images count: <r:show var='p_nodes'/>
<r:link page='previous'/> <r:show var='bar'/> <r:link page='next'/>
</ul>

This method abstracts all relations between nodes. It is used to change the context.

If the new context is empty, the tag is not rendered unless it contains an add method and the visitor has write access to the new context. In the example above, if ‘references’ is empty, the ul tag will not be present in the rendered page.

You can use the attributes from the node, its version and its dynamic attributes in the pseudo sql clause. Please note that you can only use ‘and’ in this clause. Try to use as few dynamic attributes in the clause because each one adds a join to the SQL query making it slower.

The last example above produces a single sql query, mixing ‘notes’ and ‘news’ into a single list.

ajax pagination

An ajax pagination lets you update only a specific block (id pagir in this example) when the user presses on “previous” or “next”.

<div id='pagir' do='block'>
  <ul do='images' in='site' order='created_at desc' limit='8' paginate='foo'>
    <li><b do='[foo_nodes]'/> nodes</li>
    <li>
      <r:link update='pagir' page='previous' do='t'>previous</r:link>
      <r:show var='foo'/>/<r:show var='foo_count'/>
      <r:link update='pagir' page='next' do='t'>next</r:link>
    </li>
    <li do='each' do='link' do='img'/>
  </ul>
</div>

Note the special variables “foo_count”, “foo_nodes” and “foo” named after the paginate key. These variables have the following meaning:

  • foo_count page count
  • foo_nodes number of nodes
  • foo current page number

The page size is defined by the limit clause in the pseudo sql finder (8 in our example).