onjegolders Posted January 14, 2013 Posted January 14, 2013 Hi guys, Do any of you have any idea why my stylesheet is coming up empty on any page other than the homepage? Thanks. EDIT: If I view source and click on the stylesheet it says "Error Exception: Template file does not exist" - it's looking for my 404 template.
onjegolders Posted January 14, 2013 Author Posted January 14, 2013 Sorry guys, I think it was due to not specifying the absolute path to my stylesheet. It's been a while since I kept my stylesheet outside templates folder
diogo Posted January 14, 2013 Posted January 14, 2013 If you have it outside the templates folrder, use $_SERVER["DOCUMENT_ROOT"] $_SERVER['SERVER_NAME'] to get the absolute url of your documents root. It will prevent problems if one day you change the domain. edit: sorry, wrong function! That one gives you the path, for the url use the new one.
Joss Posted January 14, 2013 Posted January 14, 2013 If you have it outside the templates folrder, use $_SERVER["DOCUMENT_ROOT"] to get the absolute path of your documents root. It will prevent problems if one day you change the domain. <- WRONG WRONG WRONG - See Diogo's correct one above!!!! OOh! Nice tip!!! Put it somewhere useful!
diogo Posted January 14, 2013 Posted January 14, 2013 Yeah, very nice tip, but it was completely wrong
Soma Posted January 14, 2013 Posted January 14, 2013 Actually this will include a subdir if pw lives in a subdir. Other than that theres no need to include server name (without protocol). A absolute path from root is simple just remember to start with a /
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now