Jump to content

Stylesheet empty when not on homepage


onjegolders
 Share

Recommended Posts

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

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

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

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

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
 Share

  • Recently Browsing   0 members

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