link

create a link

  • attr Display an attribute
  • link params Common parameters where links are created.
  • href relation to link to (default = self, can be a stored context)
    href is seldom used (see explanation below)
  • update update a block with the node/pagination
  • text static text
  • page (previous,next,list) used with pagination
  • join text to join page numbers
  • tag tag to wrap page numbers
see block, start_node, unknown
<r:link/>  link to current node, display title
<r:link href='project'/> link to the node's project, display node's title
<r:project do='link'/> link to the node's project, display project's title
<r:link mode='changes'/> link to display the node in the "changes" mode
<r:link sharp='true'/> link to anchor on the same page
<r:link sharp='true' in='parent'/> link to anchor in the parent's page
<r:link sharp='[name]'/> use 'name' instead of node id for dash (#super instead of #node23)
<r:link format='data'>download</r:link> create a link to download the data of a document
<r:link href='foo'/> link to 'foo' stored context, different from
<r:foo do='link'/>

<!-- use an area to preview projects without leaving page -->
<div id='preview' do='block'>
  ...
</div>
<ul do='projects in site'>
  <li do='each' do='link' update='preview'/>
</ul>

<r:link text='click here'/>
'sample text' will be replaced by v_title
<a do='link'>sample text</a> 
'click here' translated and used as static text
<a do='link' do='t'>click here</a> 
link using icon image
<a do='link'><img src='sample.png' do='img' src='icon'/></a>

pagination
<r:link page='next'/>
<r:link page='next' do='else'>no more pages</r:link>
pagination, ajax
<a do='link' update='foo' page='next' do='t'>next page</a>
page numbers
<r:link page='list' join=' | '/>
page numbers with else clause (pagination_key = foo)
<ul do='link' page='list'>
  <li do='link' foo='[foo_page]'/>
  <li class='current' do='else' do='[foo]'/>
</ul>

If the text inside the link text is static, it is not used and is considered as sample text to help creating the template. If you want static text, you should use do='t' (translate).

Be careful with the use of the href parameter: it should only be used to display a node and link to another. Using <r:project do='link'/> will render nothing if the project is not found. If you use <r:link href='project'/> you will get a dummy link <a href='#'>...</a> in the same situation.