anchor

An article by Gaspard Bucher

Creates an anchor.

  1. action
  2. ajax
  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
    1. anchor
    2. link
    3. path
    4. url

Creates an anchor.

anchor ‘true’ (default) | RubyLess evaluated string

see anchor, link, String, zena 1.0

It is equivalent in functionality to the anchor attribute but contrarily to the latter, it inserts an anchor tag “in place” :

<tr do='each'>
  <td><r:anchor/><r:zazen attr='text'/></td>
</tr>

Will produce something like this:

<tr>
  <td><a class='anchor' name='node22'></a>...zazen content</td>
</tr>

You can also use RubyLess evaluated strings to build the anchor name:

<r:anchor anchor='foo#{id}'/>

If you intend to use textual values that could contain non-ascii characters, you should encode them (see String) :

<r:anchor anchor='foo#{title.urlencode}'/>