简体   繁体   English

Drupal以块显示图像

[英]Drupal Displaying Images in block

I have problem with displaying img in my block. 我在块中显示img时遇到问题。

I created block with images: 我用图像创建了块:

在此处输入图片说明

Mode "Full Html" : 模式“完整HTML”:

<p><img alt="" src="/sites/default/documents/f_logo_1.jpg">
<img alt="" src="/sites/default/documents/f_logo_2.jpg">
<img alt="" src="/sites/default/documents/f_logo_3.jpg" style="height:48px; width:104px">
<img alt="" src="/sites/default/documents/f_logo_4.png" style="height:44px; width:211px"></p>

But after save, i see only title and no one tag img. 但是保存后,我只能看到标题,而没有一个标签img。 Also i tried add text like "lorem..." and its work with all other tag like strong, p, em. 我也尝试添加诸如“ lorem ...”之类的文本,并将其与所有其他标记(如strong,p,em)一起使用。

Thank you for attention. 感谢您的关注。

It really looks like Text Filtering issue, but if you have Full HTML mode - all must be good. 它看起来确实像是文本过滤问题,但是如果您具有Full HTML模式-一切都必须很好。 Ok, try this: 好的,试试这个:

  1. Go to modules page and enable PHP filter module (core module) 转到模块页面并启用PHP过滤器模块(核心模块)
  2. Save your block with PHP code mode 用PHP代码模式保存块
  3. It MUST work =) 它必须工作=)

I found solution :) It was problem with Text Formats. 我找到了解决方法:)文本格式有问题。

Solutions is : Configuration -> Content writing ->Text Formats and HTML tags authorized 解决方案是:配置->内容编写->授权的文本格式和HTML标签

<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd><img>

try to place image in a div or p like 尝试将图像放在div或p

<div>

 <div><img src="" /></div>
 <div><img src="" /></div>
 <div><img src="" /></div>
 <div><img src="" /></div>

</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM