两个或多个 Drupal Views 页面显示是否可以共享相同的路径?
我想让用户登陆页面并查看取决于她的角色的视图。当我尝试创建具有相同路径的两个视图时,Views 并没有反对。但我想知道它是否不应该以这种方式工作。
I would like to have a user land on a page and see on view that depends on her role. When I tried to create two views with the same path, Views did not object. But I'm wondering if it's not meant to work this way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是两个视图还是同一视图上的两个显示器?根据视图模块的维护者的说法,同一视图上的两个显示器应该是可以有相同的路径,但两个不同的视图不应该有相同的路径。
Is it two views or two displays on the same view? According to the maintainer of the Views module, two displays on the same view are meant to be able to have the same path, but two different views should not be able to have the same path.
如果视图的结果基于用户的角色,那么我建议使用一个视图/显示,但使用用户的角色作为参数。
如果您有少量不经常更改的角色,您可以创建单独的显示并在视图中为每个角色调整显示的“访问”设置。我不认为这是最佳实践,但在某些情况下这可能符合要求。
If the results of the view are based on the user's role then I would recommend using one view/display but use the user's role(s) as an argument.
If you have a small number of roles that don't change very often you could create individual displays and adjust the display's 'Access' settings in the view for each one. I would not consider this a best practice but there might be certain situations where this is fits the bill.