I have a few custom theme settings which so on my themes settings page.. this all works fine and as expected.

I now need to create a view that gets that custom theme setting. I can't find anything on how to do this.

I have installed the views php module and I know this theme_get_setting('setting_name') is what i used to get the theme settings in my template.php file.

Any help with this will be much appreciated.

Regards C

  • Could you be more specific about what you're trying to do? If you want to theme the view, you can always make a template. – Patrick Kenny May 1 '12 at 4:54
  • Hi Patrick. I know how to create a template but I'm stuck on getting a custom theme setting from the database. It's that variable that I need to use in my view/template. I hope that makes more sense. – cybercampbell May 1 '12 at 4:57
  • do want make some pages like customize theme for non-admin user? – Mohammad Ali Akbari May 1 '12 at 5:27
  • 1
    How exactly is theme_get_setting() not working for you? Are you getting an error message or a different output than expected? – sheena_d May 2 '12 at 5:41
  • 1
    Did you try adding the name of the theme that has that setting as the second value passed to the function? i.e. theme_get_setting('tm_qrule_url', 'themename');? – sheena_d May 2 '12 at 14:57

Just for other people who come across this here is the answer:

<?php print theme_get_setting('tm_qrule_url'); ?> works using the views_php module

It doesn't show in the views preview but does in the actual page load.

Thanks goes to @sheena_d for helping with this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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