Version française

WebSitePP : HTML pre-processor


Frequently Asked Questions
Previous  Next 

  1. How can I structure my site with subdirectories ?
  2. What is the ideal structure of the description file ?
  3. What if my site requires only one language ?
  4. How can I create a table with cyclic color rows ?
  5. How can I create a menu without the useless link on the current page ?
  6. How can I have an empty variable/parameter, which are useful for default behaviors ?
  7. Does WebSitePP works under windows ?


  1. How can I structure my site with subdirectories ?
    You just need to write them in the page name.
    The page "Toto" is at the site root, the page "SubDir/Toto" is in the "SubDir" directory.
    Note: If you use subdirectories, do no forget the RELPATH command, which handles the conversion of a filename starting from root to a filename starting from the current page (relative path).

  2. What is the ideal structure of the description file ?
    The input file would contain only INCLUDE tags.
    First ones would be dedicated to generic libraries, and the site specific libraries.
    Then would come INCLUDE tags for each page group. These included files would contain either the small pages or an include of the big ones.
    Last would be "index" page name definitions (except the site entry), one per directory, which would redirect toward a page of the directory.
    A directory could be dedicated to images, and another for other data (downloadable files...)
    A page definition should be reduced to a macro call, with parameters like title, keywords and the page content. The macro would handle the HTML formatting (header, body, main table...) and set the content at the right place.
    Such a structure has the huge advantage to allow a radical graphic design change of all the pages just with one macro change (it separates content and look, principle of CSS).

  3. What if my site requires only one language ?
    You must declare at least one language for WebSitePP to work.
    So just declare one and forget it and the L tags...

  4. How can I create a table with cyclic color rows ?
    You just need to insert the following tests in a macro called at each table line. The result color is in the macro COLOR. In this example, the chosen colors are #111111, #222222 and #333333.
    For two colors, the simple test below is enough:
    <IF EQUAL COLOR #111111> <DEFINE COLOR #222222> <ELSE/> <DEFINE COLOR #111111> </IF>
    For three or more colors, a temporary value is needed (test order matters):
    <IF EQUAL COLOR #333333> <DEFINE COLOR temp> </IF>
    <IF EQUAL COLOR #222222> <DEFINE COLOR #333333> </IF>
    <IF EQUAL COLOR #111111> <DEFINE COLOR #222222> </IF>
    <IF EQUAL COLOR temp > <DEFINE COLOR #111111> </IF>

  5. How can I create a menu without the useless link on the current page ?
    Just set the following test around the tags <a> and around the tag </a>, with XPAGE the page of the menu, target of the link: <IF NEQUAL SELF_PAGENAME XPAGE> <a href...> ou </a> </IF>

  6. How can I have an empty variable/parameter, which are useful for default behaviors ?
    An empty variable/macro may be created with <DEFINE TOTO></DEFINE> but no test on it will work because the IF tag needs to detect the value to test as a string.
    Be careful, because a IF tag without the value parameter leads to an existence test, which totally differs.
    To solve this problem, just give a particular value that you choose for such case, "None" for instance.

  7. Does WebSitePP works under windows ?
    Python is a portable programming language, so WebSitePP should work properly under windows. However no try have been driven yet, but it is planned !
    One constraint in this case: Paths must use the UNIX notation, i.e. the "/" character instead the "\" character.

Previous  Next 

visiteurs
Generated with webSitePP.py tool
Last updated on October 20, 2004