Could anyone give me some guidance on how to create a new theme setting (aka theme feature) that would allow an admin to upload a header image (similar to how it is possible to upload logos)?

I found a guide on how to do it for Drupal 6, but it is not working for me in 7. The guide is here:
http://www.lullabot.com/articles/customizable-header-images-your-drupal-....

I made these two changes for Drupal 7 compatibility:
1) file_check_directory --> file_prepare_directory
2) function MYTHEMENAME_settings($settings) --> function simple_form_system_theme_settings_alter(&$form, &$form_state)

The custom setting shows up and I can get as far as browsing and selecting an image. However, when I click to save the settings I get this error:
"The specified file temporary://image_2.jpg could not be copied, because the destination simple_header_image.jpg is invalid. This is often caused by improper use of file_unmanaged_copy() or a missing stream wrapper.
Notice: Undefined property: stdClass::$filepath in simple_form_system_theme_settings_alter() (line 42 of /home6/resoure0/public_html/drupal/sites/all/themes/simple/theme-settings.php)."

Any thoughts?

Comments

johnalbin’s picture

Status: Active » Fixed

You could either find some good code here: http://drupal.org/project/noggin

Or just use the module. :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.