Cumulus template file: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
no edit summary
mNo edit summary
 
Consequently, a single template will actually generate a different file each time Cumulus processes that template because the part of the content that was web tags is now populated with text (values, times, dates, etc.) and, as these values change, a newly generated file is different to the previous generated file.
 
=Original cumulus software=
 
==Template files provided==
 
 
There is one template that is held within the legacy Cumulus code, this generates the default [[Realtime.txt]]. It is possible to generate different content
 
The other template files are always installed into a sub-folder: '''cumulus\web\originals''' (except for very early versions). As its name suggests, "web" sub-folder holds templates that generate web pages for Cumulus to then upload to your web server.
 
When you run the install package (see [[Setup]], you can choose whether these ''web template files'' are also installed into the parent folder '''cumulus\web'''.
*This allows you to use only some of the templates (you only include the ones you want the software to process, and delete the others).
*It also means if you have modified the provided template files (keeping original names), the installation process will not overwrite them and you can continue to have the software process your modifed template files.
 
Steve Loft made it clear that the '''web template files'' his wife (Beth) designed, were their files, and only included in his software as examples to help you devise your own template files. He said, we never thought that people would use our files without modification. Each of these templates, after processing becomes a fully working web page that can optionally be uploaded to your web server.
 
To help people using the legacy software, there is more about processing of files on the [[Customised templates]] page, but think of a template as containing text that Cumulus copies from the template file to the web page it is constructing. The processing process is basically a parse, each time Cumulus finds a '''web tag complete with any parameters it needs''', Cumulus software looks up the value that it will use to replace that web tag in the web page it is creating before moving on through the text.
 
The example web templates provided by Cumulus insert a "T" at the end of the intended web page name before the extension (.htm or .html), so that the template files and generated web pages cannot be confused.
 
You may find the information on the [[FAQ#Website|FAQ]] page helps answer some of your questions.
 
 
''Note: When you put a tag into your template, be careful that whatever program you are using to develop your web pages doesn't change the angle brackets to slightly different symbols -- this is a common cause of failure!'' There are a number of editing tools that are '''designed for editing programming code''' and you should use one of those (e.g. Notepad++, Brackets, NoteTab Light, HTML kit, amongst many others), ''rather than a tool designed for web page design editing'' (e.g. Dreamweaver, word press, amongst others).
 
To summarise the necessary tasks:
#You can create a template file that has a structure of HTML elements with Cumulus web tags to represent the information you want included.
#Next you ask Cumulus [[Customised_templates#What_to_select_on_the_.27Files.27_tab_of_the_Internet_Settings_screen_within_the_.27Configuration.27_menu|to process]] that template file, it will create a HTML page from the template, and during that file creation replace the tag with the current value of the item the tag represents.
#You also need to tell Cumulus that the resulting HTML file is to be uploaded to the internet (or copied to a local web server).
 
 
 
In the web tag to PHP variable scripts, I have posted, see [[Php_webtags#Minimised_Upload_size]], I have tried to introduce better consistency in the PHP variable names, so "T" is added as a suffix to all "today" variables for example. Some other script authors try to match the inconsistent web tag names, so their script variable names are also inconsistent.
 
 
 
=Cumulus MX=
 
The admin interface relies on .json files transferred via the [[Cumulus_MX_Local_API#Predetermined_Data|application program interface (api)]], again these are generated within the code and cannot be modified, although scroll up on the linked Wiki page to find out how you can write customised api calls.
 
 
=Original cumulus software=
 
==Template files provided==
 
 
There is one template that is held within the legacy Cumulus code, this generates the default [[Realtime.txt]]. It is possible to generate different content
 
The other template files are always installed into a sub-folder: '''cumulus\web\originals''' (except for very early versions). As its name suggests, "web" sub-folder holds templates that generate web pages for Cumulus to then upload to your web server.
 
When you run the install package (see [[Setup]], you can choose whether these ''web template files'' are also installed into the parent folder '''cumulus\web'''.
*This allows you to use only some of the templates (you only include the ones you want the software to process, and delete the others).
*It also means if you have modified the provided template files (keeping original names), the installation process will not overwrite them and you can continue to have the software process your modifedmodified template files.
 
Steve Loft made it clear that the '''web template files'' his wife (Beth) designed, were their files, and only included in his software as examples to help you devise your own template files. He said, we never thought that people would use our files without modification. Each of these templates, after processing becomes a fully working web page that can optionally be uploaded to your web server.
 
To help people using the legacy software, there is more about processing of files on the [[Customised templates]] page, but think of a template as containing text that Cumulus copies from the template file to the web page it is constructing. The processing process is basically a parse, each time Cumulus finds a '''web tag complete with any parameters it needs''', Cumulus software looks up the value that it will use to replace that web tag in the web page it is creating before moving on through the text.
 
The example web templates provided by Cumulus insert a "T" at the end of the intended web page name before the extension (.htm or .html), so that the template files and generated web pages cannot be confused.
 
You may find the information on the [[FAQ#Website|FAQ]] page helps answer some of your questions.
 
==Your own templates==
 
*As the [[Setup]] page, and the notes above, indicate, the legacy cumulus software uses a subfolder "originals" to keep the example web templates safe, allowing you to do edits in the '''cumulus\web''' folder above that.
** Such edits, as already mentioned, allow you to modify provided templates.
*Alternatively, you can write your own templates, with any names you like, place them in a new folder you create (perhaps called "cumulus Templates") and using the advice in [[Customised templates]] use them.
 
To summarise the necessary tasks:
#You can create a template file that has a structure of HTML elements with Cumulus web tags to represent the information you want included.
#Next you ask Cumulus [[Customised_templates#What_to_select_on_the_.27Files.27_tab_of_the_Internet_Settings_screen_within_the_.27Configuration.27_menu|to process]] that template file, it will create a HTML page from the template, and during that file creation replace the tag with the current value of the item the tag represents.
#You also need to tell Cumulus that the resulting HTML file is to be uploaded to the internet (or copied to a local web server).
5,838

edits

Navigation menu