Definition of Whitebeam XML Tags

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
    authenticate
    block
    cachecontrol
    eval
    false
    header
    include
    insertblock
    insertdebug
    macrotag
    marksession
    nomacro
    noscript
    parser
    redirect
    repeatfor
    return
    script
    if
    test
    true
    xmp
    eval
    id
    marksession
    test
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Definition of Whitebeam XML Tags

rb:insertblock

Insert output text from a named XML block

Body

Includes any valid XML/HTML markup

Attributes

Attribute Required Description

name

required

The name of the XML block to insert. Blocks are identified using the rb:id attribute

Remarks

This tag has been added with version 0.9.32 of the Presentation Engine and is not available in previous versions. It is possibleto write a macrotag that simulates this functionality in earlier versions.

This tag allows the author to insert the output of a block of XML into the output of a page. This is most often used in conjunction with the <rb:block ...> tag which identifies a block.

The name attribute idenfies the block we want to include in the output stream. Blocks are identified by marking them with an rb:id attribute.

Use of this tag can help you structure your presentation pages in a way that makes their behaviour clearer, which in turn of course aids maintainance.

When the <rb:insertblock...> tag is encountered when generating a page, the Presentation Engine will search the XML tree for the named block. If the block is not found then no output is generated.

If the named block is found then the XML subtree is executed and the textual output from that tree is used to replace the <rb:insertblock...> in the output stream.

Note that the XML tree itself is not copied. That is the XML DOM itself is not modified by this tag.

Example

This is a very simple example of how to structure a page so that it is easy to maintain. Note that this technique is especially powerful when one considers that the blocks can be included in a header file allowing the same header/footers etc to be applied to all pages very easily.

<rb:block rb:id="topbanner">
  <!-- Logo, links etc that appear at the top of the page -->
</rb:block>
 
<rb:block rb:id="leftmenu">
  <!-- Menu that appears at the left -->
</rb:block>
 
<rb:block rb:id="footer">
  <!-- Footer with copyright notice etc -->
</rb:block>
 
<table cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td colspan="2">
      <rb:insertblock name="topbanner"/>
    </td>
  </tr>
  <tr>
    <td width="150">
      <rb:insertblock name="leftmenu"/>
    <td>
    <td>
      <h1>Page body</h1>
      <p>This is the bit that changes</p>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <rb:insertblock name="footer"/>
    </td>
  </tr>
</table>

You can combine the an rb:insertblock tag with the rb:test attribute to make blocks conditional. The example above could be extended for example to include a login-block, which is only included if the site visitor is currently not logged into the site.

Whitebeam release 1.3.36
(loadtime : 8ms)