Image Field Malfunction in Blog Module
I'm trying to add an image field to the "Blog Settings" section of the CMS that I can use to allow that image to be displayed at the top of every blog page. However, while I've successfully added the field to the form in the CMS, the POST behavior of the form is weird.
What I've done:
In fuel/modules/blog/controllers/settings.php: index(): Added line 45:
$fields['top_image'] = array('type' => 'image', 'value' => '', 'description' => lang('form_helptext_top_image'));
In the fuel/modules/blog/config/blog.php: Added line 43:
$config['blog']['top_image'] = '';
In the database table fuel_blog_settings: Added another row with "name"="top_image" and "value"=""
What happens:
I get the field in the "Blog Settings" section of the CMS, whenever I click save (whether I've chosen a file or not), the field gets saved as "{mypath}/assets/images". It doesn't even add whatever I've entered into the field at the end of that path. It just saves it as that path no matter what I do. After digging around a little, I found that the POST value for the field was always being given that value, and I'm not sure why. Any help I can get figuring out why this is happening would be greatly appreciated.
Comments
Also, as an FYI, in the 1.0 beta, blog settings has been removed in favor of the FUEL settings module:
https://github.com/daylightstudio/FUEL-CMS/tree/1.0
https://github.com/daylightstudio/FUEL-CMS-Blog-Module
https://github.com/daylightstudio/FUEL-CMS-User-Guide-Module
Array
(
[settings] => Array
(
[title] => My Blog
[description] => This is a test blog
[top_image] => /Users/kelvin/projects/fuelcms/assets/images/
[uri] => blog/
[theme_path] => themes/default/
[theme_layout] => blog
[theme_module] => blog
[allow_comments] => 1
[monitor_comments] => 1
[use_captchas] => 1
[save_spam] => 1
[akismet_api_key] =>
[multiple_comment_submission_time_limit] => 30
[comments_time_limit] =>
[cache_ttl] => 3600
[asset_upload_path] => images/blog/
[per_page] => 2
)
)
I could remove the image type value as you suggest and have my client just type in the image name, but that would require my client to upload the image first through the assets section then input the name according to that, instead of taking advantage of the "Select Image" and "Choose File" buttons that the image type provides. If at all possible, I would prefer to not have to rely on a workaround like that since my client is not technically proficient (and plus workarounds like that are easy to forget how to do). Unfortunately, I'm also under time constraints so switching to the FUEL 1.0 beta and dealing with all of the potential compatibility issues that might come with is also not an option.