Jump to content

Recommended Posts

Posted

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.

Posted

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 :)

Posted

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.

Posted
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!

Posted

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 /

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...