开发者

A question about Drupal Node and Views

I have created an "Add Question" content-type node which lets users ask questions. The questions have a title, image attachment option, and the content.

I am showing the questions which have image as a block by filtering it as "Content: Photofield - list True" in Views. This way, only the questions which have images attached to the question appear in this block. Photofield by the way is the content type.

I want to create a new block which only shows the questions which have no attached image. I have done filtering this block view by keeping filters as "Content: Photofield - list False" but in vain.

There's also some expose option and I did some messing around with it too without coming to the result开发者_StackOverflow I want.

Can anyone help?


The "Content: Photofield - list" filter only applies to nodes with an attached image, because it is filtering by the value of the "List" option (which only exists if there's an image). If the node has no attachment, this filter won't do anything.

As fas as I know, you'll need to either implement hook_views_query_alter() to add an WHERE clause to the View's query or programatically test if the node have an image in a view template.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜