Page 1 of 1

Stylesheet settings, need them to be relative

Posted: Fri Oct 03, 2008 5:34 pm
by violetweb
How do I set the stylesheets to a relative path?

Re: Stylesheet settings, need them to be relative

Posted: Fri Oct 03, 2008 6:40 pm
by Nullig
Stylesheets are usually entered into the database, so you don't need a path. If you are using external stylesheets, you need to put the path from the root /.

Nullig

Re: Stylesheet settings, need them to be relative

Posted: Fri Oct 03, 2008 6:45 pm
by violetweb
The stylesheet is set in the template as {{stylesheet}}
which loads all the stylesheets.  It takes its url setting from the config.php file.
The confg file sets the 'root' url for your site... its then subsequently uses, obviously by the stylesheet call
to explicity set the stylesheets.

$config['root_url'] = 'http://localhost/iran';

Because I use both localhost, and an external ip to expose to clients, I need my stylesheet path to be relative.
Do you know how to accomplish this task?

Re: Stylesheet settings, need them to be relative

Posted: Fri Oct 03, 2008 7:14 pm
by Nullig
The regular CMSMS stylesheets are in the database. They are not separate, external files.

Nullig

Re: Stylesheet settings, need them to be relative

Posted: Fri Oct 03, 2008 10:22 pm
by Augustas
You can try to use something like this:

Code: Select all

if($_SERVER['SERVER_ADDR']=='127.0.0.1'){
	$config['root_url'] = 'http://localhost/iran';
}else{
	$config['root_url'] = 'http://198.111.2.3/'; // IP ADDRESS
}