anchor

An article by Gaspard Bucher

add an anchor to this part of the page

  1. action
  2. ajax
  3. API
  4. classes
  5. common attributes
    1. ..._if
    2. actions
    3. anchor
    4. attr
    5. date selection
    6. draggable
    7. eval
    8. label
    9. link params
    10. name
    11. prefix
    12. publish
    13. set_...
    14. status
    15. store
    16. text, t
    17. tlabel
    18. toggle
  6. conditions
  7. context
  8. dates
  9. display
  10. forms
  11. i18n
  12. meta
  13. SQLiss
  14. urls

If you set the anchor attribute to true the anchor will be named after the current node:

<r:title anchor='true'/> --> <a class='anchor' name='node22'></a>article title

This is equivalent to:

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

You can also build more complex anchors:

<li do='each' anchor='#{parent.id}_#{id}'><r:text/></li>

Finally, note that the anchor will have the anchor class and will be inserted before the tag:

<a class='anchor' name='foo_bar'></a><li>blah blah blah</li>

You must therefore be careful not to use anchor on “tr” or “td” elements. In this case you should use anchor tag:

<td><r:anchor/></td>

If you need to show the full enclosing “td”, you will need to use CSS to move the anchor above:

.anchor { display:block; position:relative; top:-2em; }