dqmg80654
2015-03-16 08:08
浏览 42
已采纳

如何在Drupal 7中创建自定义块?

I want to create a custom block in which I want to show custom form.

Form will contain only two element.

  • input box (#centimeter)
  • submit button

When this submit button is clicked I want to convert this centimeter in inch and display the result below this form and I want to show this in block in sidebar.

My questions:

  1. How to do this?
  2. I tried following link but don't know where to write the code - should I create any php file in some folder?
  3. What to do if I want to show this block as a page with some url like /measurement/convert-cm-to-inches

http://kahthong.com/2013/06/create-your-own-custom-drupal-block-programmatically

图片转代码服务由CSDN问答提供 功能建议

我想创建一个自定义块,我想在其中显示自定义表单。

表单只包含两个元素。

  • 输入框( #centimeter
  • 提交按钮

    单击此提交按钮时,我想以英寸为单位转换此厘米并在此表单下方显示结果,我想在侧栏中的块中显示此内容。

    我的问题:

    1. 如何做到这一点?
    2. 我试过以下链接但不知道在哪里写代码 - 我应该 在某个文件夹中创建任何php文件?
    3. 如果我想将此块显示为带有一些URL的页面,如 / measurement / convert-cm-to-inches

      http://kahthong.com/2013/06/create-your-own-custom-drupal-block-programmatically

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题