Re: [css-d] Selecting CSS file depending on Server using the HTML Page
On 12/12/07, Charlene [EMAIL PROTECTED] wrote: My explaination is a little bit complicated and not using the proper technical terms. I'm sorry about that but I have a bad cold but a hard deadline. I am setting up a bunch of subdomains such as a.domain.com, b.domain.com... domain.com (or www.domain.com). The page I'll be referencing (call it frame.htm) using an Iframe is on the www.domain.com main folder. Each of the subdomains will have its own stylesheet. iframe name=I1 src=http://domain.com/frame.htm; frameborder=0 height=87 width=96% scrolling=no/iframe I'd like to set the stylesheet in frame.htm to use the stylesheet for the subdomain (ie a.domain.com/css/style.css or b.domain.com/css/style.css). Is there an easy way of doing it? BTW this frame.htm is created 5 times a day, so I would rather not copy it into 30 subdomains 5 times a day. Presumably you are assembling the page with some server-side scripting language. Most of them have some system variable which contains the full domain used in the request (usually the variable name is some variant of 'HTTP_HOST' if the server is Apache). This would allow you to inject the correct FQDN into the stylesheet call. (Using this method it should be possible to eliminate the iframe, too). Alternatively there should be a solution possible via MOD_REWRITE: Have the web pages call a constant path for the css file and modify it according to the domain. My Mod rewrite skills aren't up to actually giving an example. -- Richard Grevers, New Plymouth, New Zealand Dramatic Design www.dramatic.co.nz __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Selecting CSS file depending on Server using the HTML Page
Richard Grevers wrote: On 12/12/07, Charlene [EMAIL PROTECTED] wrote: My explaination is a little bit complicated and not using the proper technical terms. I'm sorry about that but I have a bad cold but a hard deadline. I am setting up a bunch of subdomains such as a.domain.com, b.domain.com... domain.com (or www.domain.com). The page I'll be referencing (call it frame.htm) using an Iframe is on the www.domain.com main folder. Each of the subdomains will have its own stylesheet. iframe name=I1 src=http://domain.com/frame.htm; frameborder=0 height=87 width=96% scrolling=no/iframe I'd like to set the stylesheet in frame.htm to use the stylesheet for the subdomain (ie a.domain.com/css/style.css or b.domain.com/css/style.css). Is there an easy way of doing it? BTW this frame.htm is created 5 times a day, so I would rather not copy it into 30 subdomains 5 times a day. Presumably you are assembling the page with some server-side scripting language. Most of them have some system variable which contains the full domain used in the request (usually the variable name is some variant of 'HTTP_HOST' if the server is Apache). This would allow you to inject the correct FQDN into the stylesheet call. (Using this method it should be possible to eliminate the iframe, too). Alternatively there should be a solution possible via MOD_REWRITE: Have the web pages call a constant path for the css file and modify it according to the domain. My Mod rewrite skills aren't up to actually giving an example. MOD_REWRITE might work but the other won't because the PHP (cron job - run once a day) is creating only ONE file. Of course I could have the PHP create 30+ almost identical files in each of the subdomains. And then write a program to be sure there is an updated file in each of the 30+ subdomains. I was looking around and the other solution may be to have JavaScript in the outer page (in *a.domain.com*) which can interpret GET values by an IFrame call to the page. Like: iframe name=I1 src=http://domain.com/frame.htm*subdomain=a*; frameborder=0 height=87 width=96% scrolling=no/iframe A third solution I'm looking at is using AJAX to read the http://domain.com/frame.htm file and inserting it into the spot in the main document where it belongs instead of an IFrame. This means that I no longer have to worry about http://domain.com/frame.htm using a CSS file since it is only html text and will use the CSS file of the main page which is what I really want. __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Selecting CSS file depending on Server using the HTML Page
On Tue, 11 Dec 2007 18:46:29 -0600 Charlene wrote: [snip type=agressive /] MOD_REWRITE might work but the other won't because the PHP (cron job - run once a day) is creating only ONE file. Of course I could have the PHP create 30+ almost identical files in each of the subdomains. And then write a program to be sure there is an updated file in each of the 30+ subdomains. [snip type=additional /] So why dont you just generate the contents of the body with your PHP cron job and use a PHP include for the common contents on each site. To bring this back on topic, a different head for each site will allow seperate style sheets to be used. Due to the OT nature of this discussion, if you want to explore this option more, email me off list. -- Michael All shall be well, and all shall be well, and all manner of things shall be well - Julian of Norwich 1342 - 1416 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/