Closed (fixed)
Project:
Weather
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Nov 2011 at 11:54 UTC
Updated:
15 Apr 2012 at 15:11 UTC
Jump to comment: Most recent file
I want to use a custom image path with the weather module, but the default images are added to the $weather object.
Changing weather_theme.inc (line 38)
$weather->image_filename = file_default_scheme() . ':/' . $path . '/' . $metar->image . '.png';
to $weather->image_filename = file_default_scheme() . '://' . $path . '/' . $metar->image . '.png';
makes is_readable return true for the custom folder.
But now $weather->image_filename returns the image path with the streamwrapper scheme.
How do i theme an image using the public:// path?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | weather-custom_images_path-1354586-weather_tpl.patch | 767 bytes | svdhout |
| #1 | weather-custom_images_path-1354586-weather_theme_inc.patch | 1.17 KB | svdhout |
Comments
Comment #1
svdhout commentedRendering an image from a public scheme uri:
theme('image', array('path' => $weather->image_filename, 'alt' => $weather->condition, 'title' => $weather->condition));I've added the width and height values to the $sweaver object and use them in the theme function as well:
base_path() does not need to be added in front of the scheme.
Comment #2
jospBln commentedThanks for the patch! How do I add a class to the image?
Comment #3
jospBln commentedok, got it:
Comment #4
toddy commentedThis is fixed now and will be part of the next release.