onjegolders Posted January 14, 2013 Share 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. Link to comment Share on other sites More sharing options...
onjegolders Posted January 14, 2013 Author Share 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 Link to comment Share on other sites More sharing options...
diogo Posted January 14, 2013 Share 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. Link to comment Share on other sites More sharing options...
Joss Posted January 14, 2013 Share 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! Link to comment Share on other sites More sharing options...
diogo Posted January 14, 2013 Share Posted January 14, 2013 Yeah, very nice tip, but it was completely wrong Link to comment Share on other sites More sharing options...
Soma Posted January 14, 2013 Share Posted January 14, 2013 Umm $config->urls->root ? 3 Link to comment Share on other sites More sharing options...
Soma Posted January 14, 2013 Share 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 / Link to comment Share on other sites More sharing options...
onjegolders Posted January 15, 2013 Author Share Posted January 15, 2013 Thanks all of you. Link to comment Share on other sites More sharing options...
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