简体   繁体   English

(Drupal 6视图)如何制作一个显示特定节点列表的视图(按节点ID)?

[英](Drupal 6 Views) How can I make a view that shows a list of specific nodes (by node id)?

I'd like to manually specify a view to show certain nodes. 我想手动指定一个视图以显示某些节点​​。

I can add a Node id filter (eg display if node id = 50), but I can make a multiple filters becomes they are "AND"'d (eg display if node id = 50 AND node = 51). 我可以添加一个节点ID过滤器(例如,如果节点ID = 50则显示),但是我可以使多个过滤器成为“与”(例如,如果节点ID = 50 AND节点= 51则显示)。

I'd prefer to not have to use taxonomy or whatever, as Im not currently using this. 我希望不必使用分类法或其他任何方法,因为Im目前未使用此分类法。 It would be easier to just manually code the view output if thats the case. 在这种情况下,仅手动编码视图输出会更容易。

What Googletorp says, but there is one more option: You can add an argument for Node:Nid, choose 'Provide default argument' - 'Fixed entry', enter the node ids separated with commas under "Default argument" and check the "Allow multiple terms per argument." Googletorp所说的话,但还有一个选择:您可以为Node:Nid添加一个参数,选择'提供默认参数'-'固定条目',在“默认参数”下输入用逗号分隔的节点ID,然后选中“允许”每个参数有多个术语。” box. 框。

Note that this will leave the option open to smart users to specify other node id's in the url, thus changing the output of the view. 请注意,这将使该选项向智能用户开放,以便在URL中指定其他节点ID,从而更改视图的输出。

You got some options. 您有一些选择。

  • If the nodes are in range, fx nids 50, 51, 52, 53 , then you can use between/range option in the filter. 如果节点在范围内,则fx nids 50, 51, 52, 53 ,则可以在过滤器中使用between / range选项。
  • If it's random nodes fx nids: 3, 50, 340 , it's a bit more difficult, as the views UI doesn't allow OR queries. 如果是随机节点FX NIDS: 3, 50, 340 ,这是有点难度,因为意见UI不允许或查询。 You can either, use the views OR module Note it's still in dev version or you can create the query yourself with hook_views_query_alter 您可以使用views或模块 ,也可以使用它,也可以使用hook_views_query_alter来创建查询。

You can use Views 3 (currently in alpha3 and quite stable). 您可以使用Views 3(当前在alpha3中并且非常稳定)。 It supports OR out of the box. 它开箱即用地支持OR

But are you dynamically passing the Node Id's via an argument? 但是,您是否通过参数动态传递了节点ID? If not then why don't you consider using Nodequeue module? 如果不是,那为什么不考虑使用Nodequeue模块呢? It will allow you to precisely specify what nodes should be shown. 它将允许您精确指定应显示的节点。

Nodequeue works well in Views 2 and Views 3. Nodequeue在View 2和View 3中运行良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Drupal:如何在视图中列出与配置文件节点相关的所有节点? (不是核心配置文件)。 - Drupal: How do I list inside a view all nodes related to a profile node? (not the core profile). Drupal,视图:搜索过滤器,如何忽略某些节点? - Drupal, Views: Search FIlter, how can I ignore some nodes? Drupal 6次观看。 如何使视图标题成为节点标识参数的节点标题? - Drupal 6 views. How to make the views title the node title of the node id argument? 如何在Drupal 6中由特定用户查看和管理所有节点? - How do I view and manage all nodes by a specific user in Drupal 6? Drupal 7-没有特定节点ID的显示视图 - Drupal 7 - show view without a specific node id 如何过滤“严格属于自己的节点”的节点引用? (Drupal 7) - How can I filter node references to 'strictly own nodes' ? (Drupal 7) 如何创建包含节点和文件的DRUPAL视图? - How can i create a DRUPAL view mixed with nodes and files? 使用EntityReference,如何创建一个Drupal块来显示哪些节点引用了当前节点? - Using EntityReference, how do I create a Drupal block that shows which nodes reference the current node? 如何获取Drupal中节点列表的特定字段? - How to get specific fields of a list of nodes in Drupal? drupal创建一个视图以按节点ID捕获节点文件 - drupal create a view to grab a nodes files by node id
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM