Stylesheet settings, need them to be relative

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.
Post Reply
violetweb
New Member
New Member
Posts: 3
Joined: Thu Jan 03, 2008 6:01 pm

Stylesheet settings, need them to be relative

Post by violetweb »

How do I set the stylesheets to a relative path?
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Stylesheet settings, need them to be relative

Post 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
violetweb
New Member
New Member
Posts: 3
Joined: Thu Jan 03, 2008 6:01 pm

Re: Stylesheet settings, need them to be relative

Post 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?
Last edited by violetweb on Fri Oct 03, 2008 6:48 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Stylesheet settings, need them to be relative

Post by Nullig »

The regular CMSMS stylesheets are in the database. They are not separate, external files.

Nullig
User avatar
Augustas
Forum Members
Forum Members
Posts: 241
Joined: Wed Oct 17, 2007 6:09 pm

Re: Stylesheet settings, need them to be relative

Post 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
}
http://FollowTheRoad.com/ - living on the road...
http://www.kligys.com/ - asmeninis blog'as...
Post Reply

Return to “CMSMS Core”