Page 1 of 1

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

Posted: Wed Jun 07, 2006 12:56 pm
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,

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

Posted: Wed Jun 07, 2006 3:06 pm
by Dr.CSS
more than 1 site or page?

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

Posted: Wed Jun 07, 2006 3:31 pm
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.

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

Posted: Wed Jun 07, 2006 3:58 pm
by Dr.CSS
are all domains on the same site ie. ...
root/domain1
root/domain2
setup as folders...

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

Posted: Thu Jun 08, 2006 8:32 am
by sioux
No they're all completely separate domains each with their own installation of cmsms.

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

Posted: Thu Jun 08, 2006 1:04 pm
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?

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

Posted: Fri Jun 09, 2006 8:31 pm
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.

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

Posted: Sat Jun 10, 2006 6:43 am
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

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

Posted: Sat Jun 10, 2006 3:40 pm
by sioux
FANTASTIC - it works brilliantly - thanks very much indeed.

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