Page 1 of 1
header and footer..
Posted: Thu 10 Nov 2011 10:00 pm
by Lewis
hello all,
i have a simple question. when i make some changes in header or footer of a template, i have to make the changes to all templates, manually..
the easy way is to have a header and a footer file and include them in final template file.
is this possible ?
Re: header and footer..
Posted: Thu 10 Nov 2011 10:35 pm
by beteljuice
On the server, if you use PHP or make the pages .shtml - yes, but if you mean is there a way for Cumulus to process / merge files on your PC - NO.
Re: header and footer..
Posted: Thu 10 Nov 2011 10:40 pm
by Lewis
could I make cumulus to produce .php files, and just include a header/footer file ?
this seems ok..
Re: header and footer..
Posted: Fri 11 Nov 2011 12:32 am
by Lewis
Lewis wrote:could I make cumulus to produce .php files, and just include a header/footer file ?
this seems ok..
i came home, searched this, but there is no option for extension of the files...
Re: header and footer..
Posted: Fri 11 Nov 2011 12:51 am
by beteljuice
You would (typically) disable "Include standard files" and 'name' each file to process and upload.
That way you can create any kind of (remote) filename you want, including its extension.
If you run out of 'boxes' to put files in, you can nominate more in the .ini file.
Re: header and footer..
Posted: Fri 11 Nov 2011 10:56 am
by gemini06720
Lewis wrote:could I make cumulus to produce .php files, and just include a header/footer file ?
The easiest way to do this is to convert all the Cumulus HTM templates to static PHP templates and replace the
webtags found in those HTM templates with their equivalent
PHP variables - then Cumulus needs to upload only two data files: 'realtime.txt' and 'cumuluswebtags.php'.
Re: header and footer..
Posted: Sun 13 Nov 2011 3:06 am
by serowe
Actually - not really the easiest way at all!
Create an index.php file on you web site and include something similar to this at the start of it:
Code: Select all
include "header.php";
require ("dbconfig.php");
Us the cumuluswebtags.php file to then include all of the necessary data you want (that populates the file with live data) but the includes and requires above are then use to start/populate the various seciotns of your index.php file - so, my header.php file (the first include above) contains the following:
Code: Select all
<?php
require ("cumuluswebtags.php");
?>
<h1><?php echo $location ?> weather</h1>
<h2 style="text-align: center; text-transform: none;" >
Other code you want displayed on each page</h2>
</h1>
<table width="60%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<?php
include "menu.php";
?>
</tr>
</table>
Note that the header.php file also contains a call to include menu.php - this way you NEVER have to include the menu in anything more than one file - IOW a single file only has to ever be modified if you want to change the look/feel/content of your header, menu, footer (a similar call to footer.php is made at the bottom of index.php and also includes this code:
The call to dbconfig.php is also used so that you have a single place to update MySQL access, table names etc.
It may take you a bit of time to initially set up, but once done, every page you call need only contain the actual code to display DATA - these display pages all contain calls to headers, footers, advertising etc - anything you want that you want or need to be standardised across your entire web site and don't want to have to go changing in umpteen files if you decide to, for example, change your menuing system or add/delete items from it.
Personally (watch for the bites now) this is how the whole template system should have been designed in the first place....but that's a personal opion and obviously won't be shared by some!
Re: header and footer..
Posted: Sun 13 Nov 2011 8:10 am
by mcrossley
Personally (watch for the bites now) this is how the whole template system should have been designed in the first place....but that's a personal opion and obviously won't be shared by some!
In an ideal world yes, but many people do not have access to PHP on their web servers so HTML is the lowest common denominator for a simple template to get people up and running.
Remember Steve's focus is Cumulus, he provides the web template as a 'bonus'.
Re: header and footer..
Posted: Sun 13 Nov 2011 8:29 am
by serowe
mcrossley wrote:
Personally (watch for the bites now) this is how the whole template system should have been designed in the first place....but that's a personal opion and obviously won't be shared by some!
In an ideal world yes, but many people do not have access to PHP on their web servers so HTML is the lowest common denominator for a simple template to get people up and running.
Remember Steve's focus is Cumulus, he provides the web template as a 'bonus'.
If you are talking about a 'private' web server I might agree with you, but a commercial web host who doesn't provide PHP isn't going to survive long*.
However, that point is mute because the original question was 'how do you make this happen' and two solutions were given 35 minutes after the question was posted!
As to it being a 'bonus' - not arguing or disagreeing with that - again the question was (as above) and in the long run, thebetter solution is, as any half-decent programmer would know, to modularise what they are doing so as to prevent repetition by having to modify more than one source file in order to accomplish the same change across a system.
The solution I provided does work and isn;t rocket science and doesn't require a rocket science to implement it - ther are plenty of easy to read and understand tutorials around that will help even the most basic novice accomplish 'includes'.
* If you know of a commercial host who doesn't provide PHP - it would be nice to know who they are...even if it is just so people can be aware of them and stay away from them
Re: header and footer..
Posted: Sun 13 Nov 2011 8:44 am
by mcrossley
Can't disagree with you on most of that, however the 'free' web space that many ISPs provide is functionally limited, and lots of people for whatever reason stick with that service. Not everyone wants or needs to take it further.
Re: header and footer..
Posted: Sun 13 Nov 2011 10:54 am
by serowe
My point is that even the free services have PHP enabled - for the simple reason they don't have to pay for it to be running on their servers

.
The bottom line though is that - and again back to the original question in this thread - that yes, you can include headers and footers into the templates provided with cumulus in a number of way's without having to get anything changed on the majority of hosting services. And, to be honest, if someone is asking if this can be done I would suggest that that person is also capable of either doing or learning how to do this with PHP. Like I said - it really isn;t rocket science and there are, literally, dozens of very easy to follow tutorials that, quite honestly, make doing this a LOT easier than configuring cumulus (no - I am NOT taking a shot at anyone here).
Re: header and footer..
Posted: Sun 13 Nov 2011 1:54 pm
by beteljuice
Oh dear ...
serowe wrote:
Personally (watch for the bites now) this is how the whole template system should have been designed in the first place...
Mark wrote:... many people do not have access to PHP ... HTML is the lowest common denominator. ... the web template as a 'bonus'.
serowe wrote:As to it being a 'bonus' - not arguing or disagreeing ...
Semantics - you used an imperative in a negative manner, with malice aforethought.
serowe wrote: ... a commercial web host who doesn't provide PHP isn't going to survive long.
Misdirection once more. The statement was "many people do not have access to PHP". In this country (the home of the software and the forum) this is an undisputable fact. Most users having access to limited 'free' web space from their ISP (read cable) provider.
serowe wrote:
... two solutions were given 35 minutes after the question was posted!
Yes - most posters are quite helpful.
serowe wrote:The solution I provided does work and isn;t rocket science ... help even the most basic novice ....
Do you read the forum ?
Many (to start with) do NOT know how to organize their webspace, upload, ftp, html, etc. So getting 'commercial' webspace, a domain-name, and learning even the simplest code is Quantum physics with an unknown financial implication - all they want to start with is to play with their new kit.
serowe wrote:... make doing this a LOT easier than configuring cumulus.
"Infamy, infamy ! - they've all got it infamy"
Serowe presents alternatives and their pre-requisites as axioms rather than optional 'whistles and bells'. Furthermore; he routinely makes negative inferences as a pre-emptive strike or as a response to all else !
... and I thought
I should get out more

Re: header and footer..
Posted: Sun 13 Nov 2011 9:47 pm
by serowe
Oh ffs go back and read the original post and where he comes from and stop trying to make a mountain out of a mole hill.
Re: header and footer..
Posted: Sun 13 Nov 2011 11:29 pm
by serowe
Lewis wrote:hello all,
i have a simple question. when i make some changes in header or footer of a template, i have to make the changes to all templates, manually..
the easy way is to have a header and a footer file and include them in final template file.
is this possible ?
Lewis - just for info - check your Records page - you have a couple of records set in 2099 (can I borrow your time machine please?

)