简单的表达式引擎类别过滤器
尽管现在在 EE 上工作了大约 3 周,不管你信不信,这是我第一次尝试使用类别。我基本上有一个包含酒店、餐厅、高尔夫等类别的活动频道。在活动索引页面侧边栏上,我想显示类别,当我单击该类别时,会重新加载页面,仅包含该特定类别的条目。
通过阅读这里和那里的几篇文章,似乎使用 path="events/category/{category_url_title}" 应该可以工作。
单击时的 URL 对我来说看起来确实正确,即:事件/类别/酒店,并且页面确实重新加载,但所有事件都会显示,即使是没有该类别的事件。
我在这里错过了一些愚蠢的事情吗?频道类别标签是否应该包含在频道条目标签中?
将不胜感激您能提供的任何帮助。谢谢!
回答:
在这里回答我自己的问题。首先,我没有在我的频道标签对中指定状态(这个问题多久出现一次?!)之后,当我尝试使用 path="events/category" 时,它工作得很好,然后我读到有必须在频道全局首选项中打开才能使用类别 URL 标题的设置。
所以现在一切都好起来了!
Despite working on EE for about 3 weeks now, believe it or not, this is the first time I've tried to use categories. I basically have an events channel with categories of hotel, restaurant, golf etc. On the events index page sidebar, I'd like to display the categories which when I click reloads the page with only the entries with that particular category.
From reading a few pieces here and there it seems that with path="events/category/{category_url_title}" it should work.
The URL when clicked does look right to me ie: events/category/hotel and the page does reload, but all the events show, even the ones without that category.
Am I missing something silly here? Should the channel categories tag be wrapped in a channel entries tag?
Would appreciate any help you could give. Thanks!
ANSWERED:
Answering my own question here. First off, I hadn't specified the statuses in my channel tag pair (how often is that the problem?!) After that, when I tried with just path="events/category" it worked fine and then I read that there was a setting that had to be turned on in channel global preferences to be able to use the category url title.
So now all is well again!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在这里回答我自己的问题。首先,我没有在我的频道标签对中指定状态(这个问题多久出现一次?!)之后,当我尝试使用 path="events/category" 时,它工作得很好,然后我读到有必须在频道全局首选项中打开才能使用类别 URL 标题的设置。
所以现在一切都好起来了!
Answering my own question here. First off, I hadn't specified the statuses in my channel tag pair (how often is that the problem?!) After that, when I tried with just path="events/category" it worked fine and then I read that there was a setting that had to be turned on in channel global preferences to be able to use the category url title.
So now all is well again!
您可以用简单的方法解决您的问题。前往:
GW 类别
并且免费!我用过它并且我喜欢它。
此致。
You can sort your problem out the easy way. Head on to:
GW Categories
and IT IS FREE! I used it and I love it.
Best Regards.