Welcome Guest, Not a member yet? Register   Sign In
Asset Library
#1

[eluser]xtremer360[/eluser]
In trying to find out how to have the following work. I'm using the template and asset libraries from PyroCMS to help in aiding my CI application 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. As far as I know the code below is what is used to render a specific css file. The theme is running smoothly but when the line below gets called it renders nothing as if there is no code line present.

I'm still trying to find out why the line isn't getting rendered. I'm still needing an idea for this.

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

public_html/
application/
themes/
supr/
assets/
js/
images/
css/
bootstrap/bootstrap.min.css
views/
layouts/
default.php



#2

[eluser]xtremer360[/eluser]
Still needing help with this issue. I'm going to rephrase because I've gotten further on this.

I have added the path in my backend controller and set it and now when I open the browser for it to go find the file it says that I don't have the write permissions to view the file.

>You don't have permission to access /application/themes/supr/assets/css/bootstrap/bootstrap.css
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at dev.mysite Port 80</address>
#3

[eluser]Aken[/eluser]
Make sure you don't have an .htaccess rule blocking it somewhere.
#4

[eluser]xtremer360[/eluser]
I don't have it blocking anything. This is my htaccess. When I look inside the firebug console and expand the css file it says 404 file not found.

&lt;link href="http://dev.myurl/application/themes/supr/assets/css/bootstrap/bootstrap.css" rel="stylesheet"&gt;

However on my server I can navigate and locate the file in question.


Code:
RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(assets|addons)
  RewriteRule ^(.*)$ index.php/$1 [L]
  
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType image/x-icon "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
  ExpiresByType text/html "access plus 600 seconds"
  ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2692000, public"
  </FilesMatch>
  <FilesMatch "\\.(css)$">
    Header set Cache-Control "max-age=2692000, public"
  </FilesMatch>
  <FilesMatch "\\.(js)$">
    Header set Cache-Control "max-age=216000, private"
  </FilesMatch>
    Header unset ETag
    Header unset Last-Modified
</IfModule>

# BEGIN REQUIRED FOR WEBFONTS

AddType application/x-font-ttf .ttf
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-otf .otf
AddType application/x-font-woff .woff
AddType application/vnd.ms-fontobject .svg

<FilesMatch "\.(ttf|otf|eot|woff|svg)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>

# END REQUIRED FOR WEBFONTS
#5

[eluser]Aken[/eluser]
Is there an .htaccess file in your application folder, or any folder in between root and the assets file?
#6

[eluser]CroNiX[/eluser]
Did you alter the default .htaccess that comes in /application?
Having anything public in /application is not a good idea for security, which is why CI denies url access to that directory by default.
#7

[eluser]xtremer360[/eluser]
So your saying I should do something like ../assets/themes/mytheme/supr/css,images,js?
#8

[eluser]CroNiX[/eluser]
Yes. It should be at the same level your index.php is located. Not within /application or /system or any of their subfolders.

That's why the htaccess in those directories say "deny from all"...no URL access. Everything in there should ONLY be called via CI (index.php - like your controllers/etc).

Code:
/public_html
--/application
--/system
--/assets
--index.php

The url would be something like
http://yoursite.com/assets/css/bootstrap/bootstrap.css
#9

[eluser]Aken[/eluser]
We told you this a long time ago. Don't mix static assets and application logic. That's why Pyro uses the addons folder.
#10

[eluser]xtremer360[/eluser]
Continuing on.

0 down vote favorite


I have a development server at dev.mysite.com and I am working with coda and git to make commits and pushes to the repo which has a developmenet branch that points to my dev domain.

The file structure as of right now is this. As of right now does anyone see anything that I should reconsider changing. I'm asking this because of having a public_html inside the dev folder or what. With this setup currently when I load dev.mysite.com it shows the index of / which shows .gitignore, .git, and public_html.

[code]
../
/dev
/mysite.com
.git
.gitignore
/application
/public_html
/assets
/css
/images
/js
themes
/supr
/css
/js
/images
index.php
/system
/mysecondsite.com
/application
/public_html
/assets
/index.php
/system
/sites
/mysecondsite.com
/application
/system
index.php





Theme © iAndrew 2016 - Forum software by © MyBB