Welcome Guest, Not a member yet? Register   Sign In
access main directory, how?
#1

[eluser]snaggy[/eluser]
Here's my problem: in my view file to import for example css I write

http://www.mysite.com/themes/my_theme/cs...s_file.css

but it should be enough this

/themes/my_theme/css/my_css_file.css

still it doesn't work, not even in JS or images or whatever else. I have no .htaccess file.

what could be causing this?


another question, I'd like to put my view file (actually through the parser) in the theme directory, or at least create a view file that loads the current theme from that directory. How can this be done? My goal is to create a simple way to add/change theme to the site


bye
#2

[eluser]esra[/eluser]
[quote author="snaggy" date="1187794897"]Here's my problem: in my view file to import for example css I write

http://www.mysite.com/themes/my_theme/cs...s_file.css

but it should be enough this

/themes/my_theme/css/my_css_file.css

still it doesn't work, not even in JS or images or whatever else. I have no .htaccess file.

what could be causing this?


another question, I'd like to put my view file (actually through the parser) in the theme directory, or at least create a view file that loads the current theme from that directory. How can this be done? My goal is to create a simple way to add/change theme to the site


bye[/quote]

Try this in your theme:

Code:
<?=base_url();?>/themes/my_theme/css/my_css_file.css

To load themes from a theme-specific directory, you need to overload the view method in the Loader library. There is a section in the user guide about extending existing libraries. The current view method loads view files from the views directory. You need to add an additional search path to also look under the themes/ directory if the view file name cannot be found.
#3

[eluser]John_Betong[/eluser]
[quote author="snaggy" date="1187794897"]Here's my problem: in my view file to import for example css I write
...
...
...
bye[/quote]

Hi Snaggy,

With directories and paths I have found that immediately before the code which sets the path I write the following line of code to find out where I am.
Code:
<?= getcwd(); die; ?>
 
 
I have also just started using the following code in my main view file and I think it will simplify my bundled images, css, java files, etc. The files will be specific to each individual application.
[code]
<html>
<head>

<base href="http://localhost/ci_application/" />

</head>
 
Give it a try and let us know how you get on.

Cheers,

John_Betong
 




Theme © iAndrew 2016 - Forum software by © MyBB