将目的地添加到 drupal 视图字段链接
如何将目的地添加到视图字段中的自定义编辑链接?
我的视图中有一个字段,我已自定义该字段以呈现为链接。如何将当前视图的页面作为目的地添加到链接中,以便当用户点击链接并填写表单时,他们将被重定向回他们所在的同一视图页面?还需要包含页码变量。
G
How can I add a desintation to a custom edit link in a view field?
I have a field in my view where I've customized the field to render as a link. How do I add the current view's page to the link as a destination, so that when the person follows the link and fills in the form, they will be redirected back the same view page they were on? Needs to include the page number variable as well.
G
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以覆盖特定字段的主题并使用 PHP 来呈现您喜欢的链接。如果您想操作视图参数,请从 $_GET['q'] 获取它们。
或者,
drupal_get_destination();将为您提供当前页面“destination=myView/with/args”以附加到链接。
You can override the theme for a particular field and use PHP to render the link however you like. Get the view arguments from $_GET['q'] if you'd like to manipulate them.
Alternatively,
drupal_get_destination(); will give you the current page as "destination=myView/with/args" to append to the link.