"Fossies" - the Fresh Open Source Software Archive

Member "anticms-0.2.1/anticms_hp/temp_en.html" (5 Nov 2005, 5507 Bytes) of package /linux/www/old/anticms-0.2.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!-- $Id: temp_en.html,v 1.2 2005/11/05 12:35:37 aurb Exp $ -->
    2 
    3 <p>Template in this system is an html (or xhtml, or whatever (must be
    4 text)) document with special tags, that instruct the system what to do (eg.
    5 write/remove text at some spot, check a condition, etc.).</p>
    6 
    7 <p>The location/name of the template file is specified in configuration.
    8 This is how a simple xhtml template looks like (if you download this CMS,
    9 you'll find the template of this website):</p>
   10 
   11 <pre>
   12 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
   13 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
   14     &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
   15 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
   16 &lt;head&gt;
   17  &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
   18  &lt;title&gt;&lt;val MAIN_TITLE&gt;&lt;/title&gt;
   19 &lt;/head&gt;
   20 &lt;body&gt;
   21 &lt;h1&gt;&lt;val MAIN_TITLE&gt;&lt;/h1&gt;
   22 &lt;hr /&gt;
   23 &lt;for AR in ARTICLES&gt;
   24 &lt;div&gt;
   25 &lt;h2&gt;&lt;val AR.title&gt;&lt;/h2&gt;
   26 &lt;val AR.body&gt;
   27 &lt;/div&gt;
   28 &lt;/for&gt;
   29 &lt;/body&gt;
   30 &lt;/html&gt;
   31 </pre>
   32 
   33 <h3>Syntax</h3>
   34 
   35 <dl>
   36 <dt>&lt;block VARIABLE&gt;TEXT&lt;/block&gt;</dt> <dd>Text
   37 <strong>TEXT</strong> is assigned to variable <strong>VARIABLE</strong>,
   38 and then this construct is replaced with an empty string.</dd>
   39 
   40 <dt>&lt;for I in VARIABLE&gt;TEXT&lt;/for&gt;</dt> <dd>If
   41 <strong>VARIABLE</strong> is an array or a structure, this construct is
   42 replaced with as many copies of <strong>TEXT</strong> as there are items in
   43 it, and every <strong>I</strong> is replaced with
   44 <strong>VARIABLE</strong><em>.current_index</em>. Also every
   45 <strong>I_CNT</strong> is replaced with current iteration number, starting
   46 with 1.  If <strong>VARIABLE</strong> is not an array nor a structure, this
   47 construct is replaced with an empty string.</dd>
   48 
   49 <dt>&lt;val VARIABLE&gt;</dt> <dd>This construct is replaced with value of
   50 variable <strong>VARIABLE</strong>.</dd>
   51 
   52 <dt>&lt;count VARIABLE&gt;</dt> <dd>If <strong>VARIABLE</strong> is an
   53 array or a structure, this construct is replaced with number of items in
   54 it, otherwise it's replaced with '0'.</dd>
   55 
   56 <dt>&lt;if 'VALUE' /EXPRESSION/&gt;TEXT&lt;/if&gt;</dt> <dd>If text
   57 <strong>VALUE</strong> matches regular expression
   58 <strong>EXPRESSION</strong>, this construct is replaced with text
   59 <strong>TEXT</strong>, if not, it's replaced with an empty string.</dd>
   60 </dl>
   61 
   62 <p> Template is processed in the same order as it is given in above list
   63 i.e.  when processing, for example, if statements, val statements will
   64 already be processed and so on.</p>
   65 
   66 <p>It is case sensitive.</p>
   67 
   68 <p>The depth of loops inside of loops inside of loops, ifs inside of ifs
   69 and other things is unlimited.</p>
   70 
   71 <h3>Variables</h3>
   72 
   73 <p>Variable names must contain only uppercase and lowercase letters,
   74 numbers and _ symbols. Indexes of arrays and structures are seperated with
   75 dots. There are three types of variables:</p>
   76 
   77 <dl>
   78 <dt>Text</dt> <dd>These are simple variables that carry a text value.</dd>
   79 
   80 <dt>Arrays</dt> <dd>These are ordered lists of variables of any type.
   81 Indexes are numbers starting with 0.</dd>
   82 
   83 <dt>Structures</dt> <dd>These are much like arrays, only not sorted and
   84 indexes are names, constructed the same way as variable names.</dd>
   85 </dl>
   86 
   87 <h3>Predefined variables</h3>
   88 
   89 <p>Apart from variables gathered from content, there are some defined by
   90 system:</p>
   91 
   92 <table cellpadding="6" cellspacing="0">
   93 <tr>
   94  <th>Name</th>
   95  <th>Type</th>
   96  <th>Description</th>
   97 </tr>
   98 
   99 <tr>
  100  <td>LANG</td>
  101  <td>text</td>
  102  <td>Indicates current language code (in this case <strong>LANG = '<val LANG>'</strong>).</td>
  103 </tr>
  104 
  105 <tr>
  106  <td>LANGS</td>
  107  <td>array</td>
  108  <td>contains text variables that contain codes of
  109 all languages the site is available in (in this case <strong>LANGS =
  110 [<for I in LANGS><if 'I_CNT' /[^1]/>, </if>'<val I>'</for>]</strong>).</td>
  111 </tr>
  112 
  113 <tr>
  114  <td>PAGE</td>
  115  <td>structure</td>
  116  <td>contains variables of various types which contain the information about the current page. In this case:
  117 <ul>
  118 <li><strong>PAGE.name = '<val PAGE.name>'</strong> (name of the page)</li>
  119 <li><strong>PAGE.link = '<val PAGE.link>'</strong> (link to the page)</li>
  120 <li><strong>PAGE.current = '<val PAGE.current>'</strong> ('true', if this
  121 page is current, otherwise 'false')</li>
  122 <li><strong>PAGE.inpath = '<val PAGE.inpath>'</strong> ('true', if this
  123 page is in path, otherwise 'false')</li>
  124 <li><strong>PAGE.subpages = []</strong> (an array that contans structures
  125 of type <strong>PAGE</strong> that contain information about subpages of
  126 this page)</li>
  127 </ul>
  128 This structure also contains attributes defined in content.
  129 </td>
  130 </tr>
  131 
  132 <tr>
  133  <td>PAGES</td>
  134  <td>array</td>
  135  <td>contains structures of type <strong>PAGE</strong> that contain information about root pages of the site.</td>
  136 </tr>
  137 
  138 <tr>
  139  <td>PATH</td>
  140  <td>array</td>
  141  <td>contains structures of type <strong>PAGE</strong> that contain information about pages that are in the current path from the root page to the current one.</td>
  142 </tr>
  143 
  144 <tr>
  145  <td>ENCODING</td>
  146  <td>text</td>
  147  <td>encoding used in the site (specified in the configuration; in this case <strong>ENCODING = '<val ENCODING>'</strong>)</td>
  148 </tr>
  149 
  150 <tr>
  151  <td>POWERED</td>
  152  <td>text</td>
  153  <td>contains a link to the homepage of this CMS, title and version (look at the bottom of this page). You can
  154 put this link on your websites if you wish :-)</td>
  155 </tr>
  156 
  157 </table>