I created a custom config file with my own global variable.

When I'm using the EE debugger, I have an output of my global variables:

Global variables EE

So, I guess, they exists and I can access to them.

The problem is that when I'm using them in my files, I have no output, my CSS files are not loaded, well, there is nothing.


<link rel="stylesheet" href="{global:css_url}style.css" media="screen" />

Did I do something wrong ??

  • Where is this code (your stylesheet link) located? In an embed? A snippet? Another global variable? Commented Dec 27, 2012 at 23:11

3 Answers 3


Have you tried just using the variable name?


If it's just a straight global variable, you shouldn't need to prepend it with "global:".

User-defined Global Variable Documentation -- see the comments for the method I believe you're using to set the variable.


Please disregard my previous answer. I wasn't fully grasping how you were naming the variables. Instead, let me answer with a question: Do your other global variables work? If not, try removing "global:" from the variable name (both when you set it and when you use it) and see if that gets you anywhere.

  • Ugh. Sorry. I wasn't processing your screenshot--which seems to indicate that you're using "global:" when you name the variable. Please disregard my previous answer. I'm editing it accordingly. Commented Dec 27, 2012 at 22:29

It seems the global variables you have defined that are specific to the environment seem unecessary. I would just use the standard site_url instead of having to define all those variables once the site is moved to a production/live server or just make them relative.

    <link rel="stylesheet" href="{site_url}/assets/css/style.css" media="screen" />
    <link rel="stylesheet" href="/assets/css/style.css" media="screen" />

Then any related uploaded content will be defined in the Upload Preferences: server path and URL path

  • I'm creating dynamic files to avoid the fact to redefine my path. It takes me times for now but after that, it's going to be easy for me to move from dev to staging to prod. Those variables are dynamic, I didn't paste every link for one environment. Thanks for your help.
    – Simon
    Commented Dec 27, 2012 at 23:55

I found the solution and It was not a problem with my global variable.

One of my config line was wrong and the rest of the code was not executed so I couldn't use them.

Everything is back to normal, thanks you again.

  • Great. Please make sure to accept your answer as the correct one my clicking on the checkmark to the left. You may have to wait a bit to click it...
    – Anna_MediaGirl
    Commented Jan 10, 2013 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.