将结果与表单一起包含在同一页面上,并使用 drupal 对结果进行主题化 [英] Including results along with a form on the same page and theming the results using drupal

查看:11
本文介绍了将结果与表单一起包含在同一页面上,并使用 drupal 对结果进行主题化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地在 drupal 中创建了一个页面,该页面在同一页面上显示了一个表单和结果.该表单的作用类似于结果的过滤器.结果包括一堆通过图表 API 模块(http://drupal.org/project/图表).结果通过标记表单元素包含在表单中(从伊顿的评论中得到:Drupal:如何在与表单相同的页面上呈现表单的结果).

I have successfully created a page in drupal that displays a form and results on the same page. The form acts like a filter of the results. The results include a bunch of html that includes google charts via the Chart API module (http://drupal.org/project/chart). The results are included in the form via a markup form element (Got that from eaton's comments here: Drupal: How to Render Results of Form on Same Page as Form).

由于我无法访问表单 API 范围之外的表单结果(例如页面回调函数),我似乎无法真正主题化结果.有没有办法将复杂的结果与表单放在同一页面上并使结果主题化?另外,是否有更好的 Drupal 方式在同一页面上显示表单结果?

Since I can't access the form results outside of the scope of the form API (e.g. like the page callback function), I can't seem to really theme the results. Is there a way to place complex results on the same page as a form and make the results themeable? Also, is there a better drupal way to display form results on the same page?

推荐答案

我对你的解决方案很感兴趣.我们使用 Views 和 Exposed Filters 做了非常相似的事情.对视图的结果和表单进行主题化是在 drupal 中要做的非常直接/标准的事情类型.示例:views-exposed-form-form_name.tpl.php 和 views-view-view_name.tpl.php.表单也是可变的查看hook_form_alter.

I'd be interested in your solution for this. We did very similar sounding things using Views and Exposed Filters. Theming both the results of the view and the form were very straight forward/standard types of things to do in drupal. Example: views-exposed-form-form_name.tpl.php and views-view-view_name.tpl.php. The form is also changeable view the hook_form_alter.

这篇关于将结果与表单一起包含在同一页面上,并使用 drupal 对结果进行主题化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆