This is TikiWiki CMS/Groupware v1.9.11 (CVS) -Sirius- © 2002–2008 by the Tiki community Tue 07 of Sep, 2010 [19:04 UTC]
Menu
  Wiki
  Forums
  FAQs

Webinterface Templates

English backlinks print PDF
similarcomment

Webinterface Templates


One intention to use PHP rather than the native C cgis was to enable users of perfparse to create custom templates. Almost all you need is HTML knowledge or a HTML editor. We use the smartyexternal link template engine to feed the HTML to the php processor. Below are some Instructions:




Create a new set of templates


On default Installations (compile prefix of perfparse is /usr/local/nagios) the default templates are located at

/usr/local/nagios/share/phpui/templates

You should first create a directory that holds your new templates:

cd /usr/local/nagios/share/phpui/templates
mkdir mytemplates

This directory name is your "theme". Then copy all default templates to your new theme:

cp *.html mytemplates

Edit your new set of templates


Now you can cd to this directory and edit the files (Example):

cd mytemplates
vi mainmenu.tpl.html

You will notice that there are some special tags in the html files. These tags start with {something} and sometimes have a ending tag {/something}.
For the unexperienced user: Just leave them alone!
For the experienced user i will list some of the mostly used tags here - all other can be fond on the smartyexternal link website.
Due to the special tags the page will not look the same in a html editor as later when delivered by php.

Special Tags


Translate the string:
{tr} something {/tr}

Output the content of a variable:
{$var}

Loop through a array:
{foreach from=$array key=keyvar item=itemvar}
...
{/foreach}

Conditional:
{if condition}
...
{/if}

Activate the new set of templates


In your perfparse.cfg set the option:

PHP_Style=mytemplates

this should match the created directory above.

Share your new set of templates


Even if you think it is not nice, many people will probably like your new design. Give something back to free software! Post it as a patch at sourceforge, send me a mail with a zip file or whatever. You'll find a way :-)

Contributors to this page: redflo .
Page last modified on Wednesday 23 of January, 2008 [21:38:53 UTC].


google search
 
Powered by Tikiwiki Powered by PHP Powered by Smarty Powered by ADOdb Made with CSS Powered by RDF powered by The PHP Layers Menu System
RSS Wiki RSS Forums
[ Execution time: 0.09 secs ]   [ Memory usage: 3.65MB ]   [ GZIP Enabled ]   [ Server load: 0.04 ]