I tried using theme_get_setting('setting_name'), it returns a blank; I don't see any other API to do this.

Comments

jflesher’s picture

This will return a NULL if called in a module but not if called from the theme:
$tempSetting = theme_get_setting('SETTING');

ericduran’s picture

I believe calling this in a module is to early in the process.

Try a variable_get('setting_name')

I might be wrong on this one. Also if it works. It might not be the most up to date settings.

But you can try.

Eric

jflesher’s picture

Yes, I did try this; it returns a null; its like the Theme has not been initialized yet.

jcmc’s picture

The right art to useeach theme is:

theme('get_setting', 'setting_name')

So as you use it, it returns nothing becouse the function wait for the secund parameter.

i hope it help you.

jflesher’s picture

I replaced the setting_name with the setting I'm trying to get from my theme; I'm not sure about the first parameter so I tried it and a few others; still no luck.
theme('get_setting', 'setting_name')

I'm beginning to think I need to get it from the system table; but I'm not sure how to parse it; I'm sure there is an API call; anyone know what it is?

Thanks

jflesher’s picture

// Get an array of settings for Theme
$settings = theme_get_settings('Name-Of-Theme');
// Now find the one you need
$themeSetting = $settings['Setting-Name'];