HomeContact
 

Admin

Admin: Publish

Web page archive (*.tar):
 
   

Creating web pages

With the micro-authoring system included with this firmware, it is quite easy to customize the web pages on this device or add new ones. With the operating system Windows, you need to install two additional programs: The script language Perl and an archive program to pack TAR archives (e.g. UltimateZip). A standard Linux normally has this software included already.

Functioning

A perl script (template.pl) will read in an HTML template file (template.html) looking for the character string "%BODY%". Next, the perl script will read all other HTML files in the current directory successively extracting the part between <BODY> and </BODY>. The extracted HTML code is then injected into the template at the %BODY% position and the outcome will be written to a new directory (./out-en/).

Referenced files (e.g. images) are copied by the perl script into the new directory as well. The character string "$(echo -n %)DATE%" is replaced by the date/time stamp of the source file. The character string "$(echo -n %)TITLE%" is replaced bye the first H1 headline found in the source file.

If the filename of the source file starts with "cgi-bin" appropriate shell commands will be inserted for web server execution. Own shell commands can be written between <SCRIPT LANGUAGE="shell"></SCRIPT> tags into the source file. During web server execution shell variables will be resolved in the standard way. Examples: "\$PWD" will output $PWD, "\$(ls /tmp)" will list the directory contents of /tmp.

The resulting destination directory (./out-en/) is then packet with all subdirectories into a TAR-, TGZ- or TAR.GZ archive. The archive file can be uploaded via this admin page. Existing pages (such as these admin pages) are not deleted during this process.

Brief Manual

  1. Fetch the authoring packet ff-web.tar from this device.
  2. Extract the files to a new directory (Linux: "tar -xvf ff-web.tar").
  3. Start the perl script: (Linux: "cd ff-web; perl template.pl en; ls out-en").
  4. Create an archive file from the output directory (Linux: "tar -cvf out-en.tar out-en").
  5. Upload the new archive file out-en.tar with this admin page.
  6. Change HTML source files and repeat from step 3.

Please note: In the authoring packet, two symbolic links are not included which are available in the /www directory of the device anyway. The warning messages "No ./netperf, No ./netserver" are normal and will simply indicate these facts.

Notes for Windows users: If the programs "tar" and "perl" are installed, the Linux commands will be accepted in the windows command prompt as well. You need to replace the "/" character with the backslash ("\"). The perl script can be executed also by double clicking the file name "template.pl".

Tips

Write valid HTML and close open <Tags> with </Tags>. Use a validating HTML editor or use a text editor with a some discipline.

Add a link to a new page to the template.html file. Copy one of the existing table rows (e.g. <TR>... Status ...</TR>) and change the tag <A HREF=""> and the text. It may be necessary to widen the left navigation bar. Search and change the WIDTH="150" attributes to the desired width.

A new subdirectory will also need a new template.html. The perl script will read in separate templates for each subdirectory. To save space, change references to existing images such as "../images/".

The TAR archive will be examined in order to cut out additional subdirectories in the archive file.

Multi-language support may be added with <SPAN LANG="xx"> tags. Also TITLE, ALT and VALUE attributes are scanned for the "All languages!xx:Text for language A!yy:Text for language B" pattern. The perl script accepts a parameter to filter out the desired language.

Changed: 13.9.2005
Top of page