donglu1971 2013-03-23 18:49
浏览 69

如何使用webform的URL参数

With webform I created a form with several pairs of components that belong to eachother. For example, a component "name" of type text field and a component "name" of type markup. The intention is that the submission of the text field will displayed in the Markup field.

Using Roles will be provided for the user which textareas should fill out and what markup fields he or she sees. In this way I want different users (students in this case) to communicate with a single user (a teacher). The text submitted by a student in a textarea will then be showed as read-only text for the teacher.

With the help of the unsurpassed Johan Falk, http://vimeo.com/18701843, can I get data from web form submission data into Views. By using the submission id (sid) on contextual filters I can select the submission of a specific student and display it. In the preview in Views this works fine.

Using contextual filters can I use with the submission ID of the input of a user (student) select. In the preview Views this works fine. Then I import the block into the markup field with the following php code:

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

Here begins my question!

The above print render ($ block ['content']); the block appears as a survey of the submissions of all users (students). However, I want use a url parameter to display a single submission of a specific user as in the preview in Views mentioned above. I have searched for a way to add a filter to this php code above but cant find a solution.

Does anyone have an idea how to tackle it? Thanks in advance.

  • 写回答

1条回答 默认 最新

  • dougan4884 2013-03-24 05:21
    关注

    If I understand your question correctly, I believe you can generate the block you want with the given filters applied solely with Views.

    1. Try creating a new view of type Webform submissions. (/admin/build/views/add)
    2. Add a Block display
    3. Add the relationship Webform submissions: User and make sure it is required.
    4. Add the filter User: Current Yes and it should be using your relationship (Webform Submission User).

    This should filter the block output to submissions from the currently logged in user.

    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类