Introduction to versatile xlet

Versatile xlet is designed to be the most flexible one for displaying a list of resources. It can be used to replace latest2, download, and grid xlet.

Before using this xlet, you should consider using latest2, download or grid xlet because those xlets are easier to use and are more efficient but do not offer the same level of flexibility as this xlet does.

The way this xlet works is by defining a mini-template (this is different from the page temple). This xlet uses the mini-template to render a number of repeating resources. Only the metadata of each resource will be used.

A typical template will look like the following:

<ul>
<repeat>
<li>Name: ${name} , ${createDate} </li>
</repeat>
</ul>

 

The repeat element will automatically repeat its children elements, depending on the number of resources available. The ${name} will bind its value to the "name" metadata automatically. Likewise does ${createDate}.

Other special predefined variables include:

  1. ${total}, the total number of resources found.
  2. ${currentPage}, the current page number
  3. ${totalPages}. total number of pages
To debug, put a <listall/> tag when you edit the block, the xlet will display all available metadata.

To create a page iterator, you have the following special tags:

  1. <span id="firstPage">any text</span>, a link pointing to the first page will be added
  2. <span id="previousPage">any text</span>, a link pointing to the previous page will be added
  3. <span id="nextpage">any text</span>, a link pointing to next page will be added
  4. <span id="lastPage">any text</span>, a link pointing to the last page will be added
Others such as lookup and formatData are the same as the resource reader xlet.
Comment
Title
Comments