|
Login |
Webinterface Templates
Webinterface TemplatesOne 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 smarty Create a new set of templatesOn 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 templatesNow 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 smarty Due to the special tags the page will not look the same in a html editor as later when delivered by php. Special TagsTranslate 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 templatesIn your perfparse.cfg set the option: PHP_Style=mytemplates this should match the created directory above. Share your new set of templatesEven 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
. |
google search |