2

基本上我创建了一个网络表单并将其作为一个块启用,现在我想将该块放在一个特定的节点中。我可以通过将其放置在“内容”区域并定义特定节点但它显示在内容末尾来做到这一点。现在如何在内容中的特定元素之间移动它?

该节点正在使用页面类型....tpl.php,它也被其他 5 个节点使用,因此我无法更改代码。

可视化它看起来像:

[ 内容 ]

-描述文本-

-视频列表-

[内容结束]

我需要将我的网络表单放在文本和视频列表之间。有办法吗?

4

3 回答 3

1

你可以走很多路,但既然你说你正在考虑模板文件:为什么不使用节点特定的模板,因为page是节点类型?

假设您在 node/123 上,那么您可以使用一个名为node--123.tpl.php (参见Drupal 7 Template (Theme Hook) Suggestions)的模板并将您的块嵌入其中。

或者,您可以通过hook_token_info在自定义模块中提供可重用的令牌,并将其与常用的token_filter模块结合使用。但这可能是最重要的,如果它只是你需要触摸的一个节点。

于 2015-08-26T19:26:05.843 回答
0

For Drupal 7 a bit of a hacky way to display the contents of a block in content would be to enable the PHP Filter module. Then edit your node and switch to the PHP code Text format and add this code

 <?php
     $block = module_invoke('block', 'block_view', '1');
     print render($block['content']);
 ?>

where '1' is the block id found in the URL when you edit the block and be sure to include the PHP tags.

Also see this page https://www.drupal.org/node/26502 for more information on placing blocks.

于 2015-08-26T19:09:14.917 回答
0

您可以使用EVA 模块将节点中的网络表单添加为字段。

您基本上创建一个视图并选择“eva 字段”选项,然后确保此视图仅选择您想要拥有的 web 表单并将其与节点相关联(EVA 模块文档的示例比我提供的要好得多)。

将其添加为字段后,您可以将其放置在节点中的任何位置。

还有可以帮助您的块参考模块。

于 2015-08-27T08:50:19.743 回答