Drupal 7:一个节点多个页面
我们在 Drupal 7 网站上列出了活动,但我们希望我们的用户能够通过简单的表单注册这些活动。我们使用 Pathauto 为使用以下模式的事件生成 URL 别名:events/[node:title]
。我们希望有另一个别名为 events/register/[node:title]
的页面来显示注册表单。我们还想使用 tpl.php 文件来创建模板,就像我们对网站的其余部分所做的那样。
关于我们如何实现这一目标有什么想法吗?谢谢。
We list events on our Drupal 7 site, but we'd like our users to be able to register for these events via a simple form. We're using Pathauto to generate URL aliases for events using the following pattern: events/[node:title]
. We would like to have another page with the alias events/register/[node:title]
which would present the registration form. We would also like to use tpl.php files for creating the templates, like we do for the rest of the site.
Any ideas on how we might accomplish this? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试注册模块。它仍在开发中,但有超过 7000 个网站正在使用它:
You can try the Signup module. It's still in development, but over 7000 sites are using it:
我会通过 node.tpl.php 文件在事件/页面上放置一个注册按钮。如果您的所有节点都不可注册,那么您可以通过使用 $node->nid 获取 $nid 来检查节点,并在 url_alias 表上运行 db_query 以查看当前节点是否符合条件。
让您的注册按钮重定向到 events/register/$node->title 页面并确保您通过了该节点。从这里开始有几种不同的方法。如果您对此部分有疑问,请打开另一个线程。
I would put a register button on the event/ page via the node.tpl.php file. If all your nodes are not registerable, then you can check the node by getting the $nid with $node->nid and run a db_query on the url_alias table to see if current node qualifies.
Have your register button redirect to events/register/$node->title page and make sure you pass the node. There's a few different ways to go from here. If you have questions about this part open another thread.