Drupal - 使用 AJAX 嵌入/更新视图页面
一整天我都在抓耳挠腮,似乎有一百种不同的方法可以完成我想做的事情,但我希望以某种方式完成它 - 但我找不到。
这是我正在做的事情:http://schmidtbrotherscutlery.com/dev/mySchmidt/myCutlery/
我的设置是一个视图,包含四个不同的页面,每个页面均按类别过滤。上面的默认页面同时列出了所有三个类别,菜单中的类别子链接会将您带到按单个类别过滤的其他三个视图页面。我需要的是每个类别子链接都使用 AJAX 加载各自的视图页面,而不是像现在这样逐页刷新。我意识到我可以通过类别上的公开过滤器有效地实现相同的目标,但我希望这些特定的菜单子链接加载视图页面,而不是使用公开的表单单独过滤一个视图。这看起来确实没有那么困难,我不知道为什么我还没有弄清楚,但我对 Drupal+AJAX 集成没有太多经验。请帮忙!
I've been scratching my head like crazy over this all day, there seems to be a hundred different ways to get what I want done but I want it done a certain way - which I can't find.
Here's what I'm working on: http://schmidtbrotherscutlery.com/dev/mySchmidt/myCutlery/
My setup is one view with four different pages, each filtered by category. Default page above lists all three categories at once, and the Category sublinks in the menu take you to the three other view pages that are filtered by a single category. What I need is each of the category sublinks to load their respective view pages with AJAX instead of page by page refresh like it is now. I realize I can effectively achieve the same thing with an exposed filter on the categories but I want these specific menu sublinks to load the view pages, not filter one view on it's own with an exposed form. This really doesn't seem to be that difficult and I don't know why I haven't been able to figure it out yet but I don't have much experience with Drupal+AJAX integration. Help please!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我读到的内容来看,听起来您应该能够将每个视图放入 jQuery 选项卡容器中。例如:
这将允许您循环浏览每个内容片段而无需刷新页面。
From what I've read it sounds like you should be able to put each of the views within a jQuery tab container. So for example:
This would allow you to cycle through each content piece without refreshing the page.