Project | WXT | Basics | Download | Documentation | Samples

Script: fragment-element

The purpose of a fragment is to define a (X)HTML fragment that may be rused. A fragment is placed on a module by the PI: Fragment . The definition-element may contain any number of fragment-elements.

<fragment id=""> .. </fragmet>
id(mandatory) Any string that will identify this fragment.
short(optional) A string. May be accessed in fragment PI instead of content. content defaults to short and short defaults to id.

The content of a fragment element may be a simple text or any legal XML-fragment wrapped as CDATA.

Note that fragment may be used as author identification, see Module . A special predefined author id, _defaultauthor, comes in handy. It defaults to Site author, and you may change it as shown below. All modules are supposed to have this author if not told otherwise.

Examples:

<fragment id="myroot">
    <![CDATA[
  <span style="font-weight:bold">
      bs
  </span>
   ]]>
</fragment>
<fragment id="mygreetings">hello all</fragment>
<fragment id="_defaultauthor">Børre Stenseth</fragment>
<fragment id="jb" short="Brown, John">
      <![CDATA[
  <div>
      Jhon Brown, Author of many books on math<br/>
      <a href="http://www.a.b">JB's blog</a>
  </div>
   ]]>
</fragment>