- Wierd Image Issue - < img src >
pan0s - October 11, 2006 - 18:14
Helloo gents and ladies
what can u really say about what im dealing with during my recent theming work
Well , i decided that i want a div to contain an image, that i would set with the very traditional way (and highly manually) of <img scr="image.png" alt="logo" />
In my surprise i dont get the image at all when the page loads. The only thing that comes up in place is the alt.
Is theres something i should know and i obviously i dont ? What really prevents the image from being displayed in my drupal site?
many thanks in advanced

where is the image located
where is the image located ?
if in an images folder then you would have to call the image like this images/image.png
hI there yes the image IS
hI there
yes the image IS located in an imgs folder within my themes folder.... ;(
if the image that you want
if the image that you want to use is inside the images folder for you theme, then you must reference it with the image folder preceeding the image.
example:
images/image.png or /images/image.png
if you are a windows users, ,right click on the "alt text" and click on properties. this will tell you what path the image is trying to use, and help you diagnose why the image isnt showing.
try to put a slash before
try to put a slash before the "image.png" right there:
"/image.png"And as you probably know, in order for it to work, while you did not write the path to your image, i assume your image is in the root folder of your site. Otherwise, if your image is in the files/images folder, you may be trying something like
<img src="/files/images/image.png" alt="logo" />Hope this helps
Ok ill make it more clear
here is the code :
<div id="left_logo_sidebar"><a href="http://localhost"><img src="/imgs/smalllogo1.png" width="85" height="100" alt="logo"/></a>
</div><!--LEFT_LOGO_SIDEBAR-->
Also there is an imgs folder within my theme folder.
Moreover the css code for the specific div is:
#left_logo_sidebar {
position:fixed;
width:85px;
height:100px;
}
view source of the rendered
view source of the rendered page, locate where the image is being called and check the path. you may not need a preceeding / you may just need imgs/image.png. see if this will help you diagnose the problem. the issue is a path issue.
if you are a windows user, right click on the "alt text" and click on properties. this will tell you what path the image is trying to use, and help you diagnose why the image isnt showing.
First of all thanks for the
First of all thanks for the interest and replies ....
Unfortunately i have bad news (for me!)
Although i corrected the path ( ) and now i get an image showing in the design view in Dreamweaver , i still dont get the image in my browser...i have serious suspicions that drupal is responsible for the failure...
Maybe somebody can try this out and post his result...
I also tried in the same way
I also tried in the same way to insert an image to a section of another theme ( provided by drupal ) and i got the same result
i found a way ... <a
i found a way ...
<a href="http://localhost"><img id="logo" src="<?php if ($logo) { ?><?php print $logo ?><?php }else { ?><?php print base_path(). path_to_theme(); ?><?php } ?>" width="85" height="100" alt="logo" /></a>
please let me know if i can make it point an image under imgs folder. Now its pointed towards the themes folder and thus i cant have the images separate.
make the paths relative to root
while using paths in your theme files assume that the theme file is in your drupal root. then the paths should include your theme folder path. not 'image.png' but '/themes/your_theme/your_image_folder/image.png'
--
ufku
Geneticists from METU
Thanks
ufku ;) ill try that...
...DRUPAL Rocks....
cheers
It is a problem..
I do the following:
- create content -> page
- input format -> full HTML
- <img scr="http://www.mysite.com/files/myimage.jpg" alt="my image">Image won't show up!
It's in the right folder. When i just drop "http://www.mysite.com/files/myimage.jpg" line into the web browser I can see the image.
I checked generated source and I can see
<p><img scr="http://www.mysite.com/files/myimage.jpg" alt="my image"></p>line inside, but i can't see the image. W.T.F.???P.S. I am testing Drupal 5.0
HTML
Spelling is important: scr != src.
To learn more about img attributes see this resource on <img>.
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
Thank you! I can't believe
Thank you! I can't believe I've made such an obvious mistake. Well, HTML (as well as English) isn't my primary language. :)