Variable Scope In Themes

Is there a way to (for example) access a variable defined in common/header.php in items/browse.php? I defined a boolean variable, $mobile, in my header.php file and want to access it in various other theme files. Seems like it should be available. But then again, I'm extremely tired today. :o ;)

- Gavin

Omeka's themes work by looking first for a header.php file in the themes own common/ directory. If one isn't found there, then it looks in Omeka core's /application/views/scripts/common for a header.php file.

So, if you are defining that variable in a theme's own common/header.php file or /application/views/scripts/common/header.php, it might or might not be reflected in the items/browse.php (or all other) file.

Double-checking whether the current theme has its own common/header.php file -- and where you are defining the $mobile variable -- will probably help determine where the mismatch might be.

You can always copy the existing application/views/scripts/common/header.php file into a common/header.php file in your theme's directory. That's the better practice in any case.