Hi,
I can get an inline Image (
to display on page nodes only if the node is designated as the home page. That designation can be done in either the publishing options or in configuration/site settings. Makes no difference.
All other page nodes with an inline image will not display the image. The outline of the image shows up as the page loads, then disappears. Then the alt text will display.
I have read about a hundred different posts and comments, none exactly duplicate this situation. I've tried the following suggestions in the other posts with no results:
two different drupal 7 installs with no difference.
Increased php memory limit to 128 M, confirmed by phpinfo();
Added an image field to the basic page node;
removed .htaccess file and/or commented out different combinations of lines 2 and 3.
Looks like it has something to do with the page node's designation as front page. But I'm at a loss as how to dig deeper.
Thanks for your consideration.
Comments
It suggests the src attribute
It suggests the src attribute for the image tag is missing a leading '/'.
additonal Info
Sorry. I could have been clearer. The src attribute is not the problem as all the pages with images are written identically. Just the image name differs.
Any one of these pages will display the images if it is designated as the home page, but will not display the images otherwise. However, only if the page is referred to in the URL as the home page (e.g. www.mysite.com/ or www.mysite.com/# ). If any page that is designated as the home page is referred to by its node number, the images will not load.
So the images loading is depending on 2 things: 1) the page must be designated as the front page as described in my first post, and 2) the front page must be referred to as described in the paragraph above and not by its node number.
Thank you all very much for responding.
How about an example of what
How about an example of what you are doing?
Example Code
This is the code that calls the image file for display on the currently designated front page: img src="sites/all/themes/zen/campbell_zen/images/home9.jpg" alt="xxxxxx " width="680" height="138"/
I remove the beginning bracket and the ending bracket from the code, trying to get it to show up in this message.
When I change the front page to be a different page, then this code no longer brings up the image for display. When the page loads, it will show the outline for the image, which then disappears, and then the alt text will display.
Change src="sites/all/themes/
Change
to
This will make src relative to the site root instead of the current path and image should show anywhere in the site.
This is the code that gets it to display
I tried your suggestion but it does not get the display. However this version does: img src="/sitename.com/sites/all/themes/zen/campbell_zen/images/image.jpg
This puzzles me, but I'm not complaining as it's working now.
Thanks for your suggestion.
Inline image display
I think the problem is in the value of the src attribute. You need to use the correct syntax to refer to an image. Your home page is loaded using the index.php file (if you omit the file name). Other nodes are loaded with the node.php file for the theme you are using. Since this file has to locate the image to load it, proper value in the src= in the img tag is important. If your theme is saved in an inner folder, for example, sites/default/themes/yourthemename folder, and your image forder is loaded at sites/default/files, them you have to step out of your theme folder by using ../. In this case, you can use
<img src="../files/yourimagefile". Make necessary changes as required so that the image file can be located by the node.php file. If you check the source code for the images in my website www.repairservicetips.com, you will see how I used inline image tags.Hope this helps.
Location of Image files
Thanks for your response. the image folder is in the same folder as the theme, and the src attribute will work if the page is designated as the front page. When not designated as the home page, it does not work. So that would lead me to believe that the src tag syntax is not the problem
Thanks again!
Code that works!!!
This is the code that works, not exactly what you prescribed, but your post got me going in the right direction. Thanks!!!
img src="/sitename.com/sites/all/themes/zen/sitename_zen/images/image.jpg