CodeIgniter Forums
Loading Assets from inside of theme folder - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Loading Assets from inside of theme folder (/showthread.php?tid=57026)

Pages: 1 2


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]xtremer360[/eluser]

In trying to find out how to have the following work. I have the template library located here and I'm trying to figure out how I can have the dashboard look for the images/css/js files in the file structure below as opposed to the regular assets folder in the public_html folder since those files only pertain to that theme.

https://github.com/philsturgeon/codeigniter-template

Code:
/application
   /themes
      /supr
          /views
              dashboard.php
          /assets
             /js
             /css
             /images
/public_html
    /assets
        /js
        /css
        /images
    index.php



Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]InsiteFX[/eluser]
If you take a look at the .htaccess file in the application directory you will see why it doe's not work.



Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]xtremer360[/eluser]
Any idea on what I should do to correct this problem and what files I would only need to make this work to show assets from the themes/current theme/ assets directory?



Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]xtremer360[/eluser]
Just odd because I don't see anything fr the pyro cms project that has a htaccess that deals with these.


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]Aken[/eluser]
You need to put your themes folder outside of the application directory, or change the .htaccess file in the directory to allow for the themes folder to be used.


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]xtremer360[/eluser]
Like I've been saying I'm trying to see how in the .htaccess file of pyro this helps it but i'm not sure.

Then again I'm not sure exactly the same issue still remains of what files are important for me to incorporate without just throwing files into my server that I don't need to accomplish this.

Like I know the asset library file but what else I wonder. Anyone know that has seen and dealt with that CMS?


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]xtremer360[/eluser]
I added this to my default.php file in my layouts folder and nothing gets echoed and I have no idea why.

<?php echo Asset::css('bootstrap/bootstrap.min.css'); ?>

I have this in my file system.

/application
/themes
/supr
/views
dashboard.php
login.php
/layouts
default.php
/parials
header.php
footer.php
breadcrumbs.php
sidebar.php
/assets
/js
/css
/bootstrap
bootstrap.min.css
/images
/public_html
/assets
/js
/css
/images
index.php


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]Aken[/eluser]
Looking at your file structure again, if your application folder is outside of your web root (assuming /public_html/ is your web root), then you can't do this at all. Static assets called via HTTP requests (images, CSS, JS) have to be accessible via the web, e.g. somewhere in your /public_html/ folder. You'll have to move your themes folder there, and adjust the file path for it in your script accordingly.


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]xtremer360[/eluser]
That's odd because Pyro doesn't have the normal setup either.


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]Aken[/eluser]
Pyro doesn't suggest putting files outside of your web root...