![](/img/trans.png)
[英]Drupal 7: add html block as field in content type insert/edit form
[英]Drupal 7. How to add a piece of reusable html (or a block) to the main content field
My website is built with Drupal 7. I created a block containing an html table that I would like to add to selected pages via a content field accepting html or php code.
我知道如何向区域添加块,但我找不到是否可以在字段内添加可重复使用的 html 块(即页面内容本身)
您可以从以下代码打印您的块:
<?php
$block = module_invoke('module_name', 'block_view', 'block_delta');
print $block['content'];
?>
https://drupal.stackexchange.com/questions/121650/render-custom-block-by-block-name
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.