attr

find value as attribute

Obsolete content (not in 1.0):

  • var Variable name stored by set.
  • If the attribute starts with v_ it’s value is read in the version.
  • If it starts with d_ it’s value is read in the version’s dynamic attributes.
  • If it starts with c_ the value is read in the version’s content.
  • path show node path (/en/image23.html)
  • url show node url (http://example.com/en/image23.html)
  • name.attr read the attribute in the stored or special node “name” (main, visitor)

For all other cases, the attribute is read in the node.

see link, show, trans, zena 1.0

This works exactly like eval except that the evaluation scope starts in the current node. This means you can for the use of an attribute with “attr” if you have a helper method with the same name for example. If you have a ‘trans’ property (same name as trans, the translation method), you could access it with:

<r:show attr='trans'/>

Which is finally the same as:

<r:show eval='node.trans'/>

obsolete docs to be removed

<r:show attr='name'/>
<li do='link' attr='v_title'/>
<r:show attr='v_updated_at'/>
<r:show attr='updated_at'/>
<!-- rss feed -->
<link rel="alternate" type="application/rss+xml" title="RSS Super site" do='void' mode='rss' format='xml' set_href='[url]'/>
<a do='void' set_href='[path]'>blah</a>

<r:set var='hours'><r:stat find='sum'/></r:set>
<r:show var='hours'/>

The last example displays the pseudo-attribute ‘url’ using the ‘show’ shortcut.

The “rss feed” example above works because the “do” tag is after type, rel and title, thus considering these parts as pure html and mode,format,set_href are after the “do” tag so they are parsed as zafu.