开发者

Drupal: images don't show up inside the block (text only)

开发者 https://www.devze.com 2023-01-08 05:05 出处:网络
I\'ve added the following code inside a Drupal block, to display an image. <img alt=\"Fuzion logo\" src=\"sites/all/the开发者_Go百科mes/zen/zen/logo.png\" />test<br />

I've added the following code inside a Drupal block, to display an image.

<img alt="Fuzion logo" src="sites/all/the开发者_Go百科mes/zen/zen/logo.png" />test<br />

I've tried several urls. For none of them I can see the image in my front-end website. The block only contains the text "test".

hostingpath/sites/all/themes/zen/zen/logo.png ---> I can see the logo in back-end (editing field, only with this)
sites/all/themes/zen/zen/logo.png
logo.png

thanks


Did you remember to use an appropriate filter that allows img tags?


Although your question was answered, I have found this also can happen when using the pathauto module with the path to your page set as a "subdirectory"; e.g. www.example.com/path/to/page.

As a result, the web server will look for your image at /path/to/page/sites/all/themes/zen/zen/logo.png because the URL is relative.

If this occurs, make sure to provide an absolute URL by including a forward slash at the beginning, i.e. /sites/all/themes/zen/zen/logo.png instead of sites/all/themes/zen/zen/logo.png.

Perhaps this answer will assist someone else with a similar problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消