Need several sites to access one html file - is it possible?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
sioux

Need several sites to access one html file - is it possible?

Post by sioux »

I would like to add footer to the bottom of every site. The footer (for want of a better name) is large file which changes regularly and it's annoying and time consuming to have to log in to every site's admin to change the two templates on each one every time it does.

I currently make a javascript call for it in {literal} tags, but for accesibility reasons would prefer not to continue this way.

I tried an ssi script but that didn't work nor a php include. Is there a way of doing this? Oh and I want to code tha call for the footer from directly within the template so users cannot fiddle with it  ;)

Thanks,
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Need several sites to access one html file - is it possible?

Post by Dr.CSS »

more than 1 site or page?
sioux

Re: Need several sites to access one html file - is it possible?

Post by sioux »

Several sites but accessing just one piece of html.

Normally I'd use a global content block but because I need the same file to appear on lots of different sites (with different domain names) I want to serve it from a central location somewhere.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Need several sites to access one html file - is it possible?

Post by Dr.CSS »

are all domains on the same site ie. ...
root/domain1
root/domain2
setup as folders...
sioux

Re: Need several sites to access one html file - is it possible?

Post by sioux »

No they're all completely separate domains each with their own installation of cmsms.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Need several sites to access one html file - is it possible?

Post by Dr.CSS »

could try making it on one site and call it to the others with a global content tag as a link in the tag...
what kind of file is it?
sioux

Re: Need several sites to access one html file - is it possible?

Post by sioux »

It's just plain html. If ssi would work that would be fine but it doesn't seem to.

It's exactly the type of content that is put in a global content block, except that that only works on one site and I want it to work across several.
cdstg

Re: Need several sites to access one html file - is it possible?

Post by cdstg »

you could make a user defined tag like

$h = fopen("http://www.yoursite.com/youtfooter.txt", "r");
$contents = '';
while (!feof($h)) {
  $contents .= fread($h, 8192);
print $contents;
}
fclose($h);

then in your pages page your user defined tag
this will only work if your webhost allows fopwn some don't for secuity reasons
you will soon see if it works though if it doesn't let me know and i will try a curl one
sioux

Re: Need several sites to access one html file - is it possible?

Post by sioux »

FANTASTIC - it works brilliantly - thanks very much indeed.

That's going to save me a huge amount of work  ;D
Locked

Return to “CMSMS Core”