如何根据提取到附加视图中的内容从默认 Drupal 视图中过滤掉内容?
目前:
我有一个页面视图,通过简单的 CCK 下拉菜单显示标记为“未推荐”的所有内容。
视图的附件显示所有“特色”内容,并且样式设置得更令人印象深刻。
我希望能够做的是在附加视图的顶部显示一些(例如3个)特色项目,并显示所有内容,无论是否在下面的视图中展示, 不包括附件中显示的 3 个。
使用 Views UI 以及可能需要的一两个自定义模块来实现此目的最简单的方法是什么?
我正在使用 Drupal 6 和 Views 2
currently:
i have a page view that is displaying all content that is flagged as "not featured" with a simple CCK dropdown.
the attachment to the view displays all content that is "featured" and is styled to be a little more impressive.
what i'd like to be able to do is have a few, say 3, featured items display at the top in the attached view, and display all content, whether featured or not in the view below, excluding the 3 displayed in the attachment.
what would be the simplest way to achieve this using the Views UI and perhaps a custom module or two if neccessary?
i'm using Drupal 6 and Views 2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有多种方法可以做到这一点。以下是一些替代方案
FState
)。本质上,您需要显示附件显示中显示的项目以及页面视图中未显示的项目。Content: FState = Featuresed
。您可以通过在“视图”过滤器下拉列表中选择“内容”组来执行此操作。选择内容:FState (field_fstate) - 允许的值
。选择精选
。确保运算符是是其中之一
is none of
编辑:
根据您的评论,我更好地了解您的要求。也许您将一些语言混合在一起,这可能会让外行人感到困惑。当您说“特色”内容时,这意味着该内容是专门显示的。因此,当您说“特色”内容也与非特色内容一起出现在页面视图中时,这可能会令人困惑。
无论如何,总而言之,我明白您现在的要求是什么(继续按照您的意思使用“特色”)
视图和页面视图。附件
视野有点多
吸引人的。
在页面视图上
那些“特色”出现在
附件视图。在页面视图上,
所有新闻文章也显示在
按时间顺序排列,不考虑
它们是否被标记为
“特色”或过去没有。唯一的条件
是不应该有
附件之间重复
视图和页面视图。
您的规格中有一点疑问......暂时忘记您的 CCK 选择字段。我的问题是:您是否想要 (a) 在附件视图中按时间顺序简单显示 4 篇最新“精选”文章,或者 (b) 您是否想要明确确定项目及其顺序附件视图?
在情况 (b) 中,您可以选择一篇可能 1 个月前的文章,因为它是一篇精彩的文章,而且您仍然想继续展示它。在(a)中你没有这种灵活性。随着新的“特色”文章的制作,旧的文章会从附件视图中移出。
当然对于情况(a) & (b) 附件视图中显示的文章不会出现在页面视图中(这应该始终成立)。
对于情况 (a),您应该对附件视图使用 Nodequeue 模块;对于情况 (b),您可以继续使用 CCK 选择列表方法来提取特色文章,就像您当前对附件视图所做的那样。要防止页面视图中出现重复项,请使用 http://drupal.org/project/views_unique 或 < a href="http://drupal.org/project/views_exclude_previous" rel="nofollow">http://drupal.org/project/views_exclude_previous 模块
There are multiple ways of doing this. Here are some alternatives
FState
) which has a state "Featured". Essentially you need to show items that are featured in the attachment display and show items that are not featured in the page view.Content: FState = Featured
. You can do this by choosing the Content group in the Views filter drop down. ChooseContent: FState (field_fstate) - Allowed values
. SelectFeatured
. Make sure the operator isis one of
is none of
Edit:
Based on your comments I understand your requirements better. Perhaps you are mixing some language together that can be potentially confusing to an outsider. When you say "featured" content, that means that the content is shown specially. So it is confusing, perhaps, when you say that "featured" content also appears in the page view along with unfeatured content.
Anyways in summary here is what I understand what your requirement is now (continuing to use "featured" in the way you mean it)
view and a Page View. The attachment
view is a little bit more
attractive.
on the page view
that are "featured" appear in the
attachment view. On the page view,
all news articles are also shown in
chronological order regardless of
whether they had been marked as
"featured" or not in the past. The only condition
is that there should be no
repetition between the attachment
view and page view.
There is a slight doubt in your specification....forget about your CCK select field for a second. My question is: Do you want to (a) Simply show the 4 latest "featured" articles in chronological order in the attachment view or (b) Do you want to explicitly determine the items and their order in the attachment view?
In case (b) you can have the luxury of choosing an article that was perhaps 1 month old because it was a spectacular article and you still want to keep showing it. In (a) you don't have that flexibility. As new "featured" articles are made, the old ones move out from the attachment view.
Of course for cases (a) & (b) the articles that are shown in the attachment view will not appear in the page view (this should always holds true).
For case (a) you should use nodequeue module for the attachment view and for case (b) you can continue using the CCK Select list method to pull out featured articles as you do currently for the attachment view. To prevent duplicates appearing in the page view use the http://drupal.org/project/views_unique or http://drupal.org/project/views_exclude_previous modules