简体   繁体   English

如何在首页drupal 8上显示“与我们联系”页面?

[英]how can i display contact us page on front page drupal 8?

I am creating scratch theme in drupal 8. Problem is occurred now i want to show contact us block display front page in footer right corner. 我正在drupal 8中创建草稿主题。现在出现问题,我想在页脚右上角显示contact us阻止显示首页。 I had used contact form module but it opens new page. 我曾经使用过联系表格模块,但是它会打开新页面。 I also used Contact block but result is nothing my concern is that how to does this? 我也使用了Contact块,但结果无关紧要,我该怎么做?

If any one knows, tell me i do not have more knowledge about drupal thanks. 如果有人知道,请告诉我我对drupal的了解还不多。

You can use this:- 您可以使用以下方法:

$block = module_invoke('module_name', 'block_view', 'block_delta');
print render($block['content']);

You define a path to your form admin/content/webform . 您定义表单admin / content / webform的路径。 Then you define your home page in Site Information admin/config/system/site-information . 然后,您在Site Information admin / config / system / site-information中定义主页。

More easy, contact block + twig tweak module, get the frontpage node theme sugestion, in my case node 2, -> node--2--full.html.twig and theming it. 更简单,联系block + twig调整模块,获取首页节点主题提示,在我的例子中为node 2-> node--2--full.html.twig并对其进行主题化。 content.field_my_field for fields and drupal_block('mymachinenamebock') -> drupal_block('contactblock') got by the twig tweaks module content.field_my_field用于字段和drupal_block('mymachinenamebock')-> drupal_block('contactblock')是由树枝调整模块获得的

您可以通过修改主题的your_theme_name.theme文件,将联系表单包括在页脚区域中。

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

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