开发者

Drupal 6 Views - Don't display a row if one field is empty

Is it possible not to display a Views row if one of i开发者_StackOverflow中文版ts constituent fields is empty?

In my case I have a list of users with their username and picture, and I only want to display those users who have uploaded an image.

Cheers!


I only have a few mins, so I didn't have a chance to test this. For the general question is it possible not to display a Views row if one of its constituent fields is empty.

Row style: Fields Row style options - Hide empty fields

Add all the (non-picture) fields for the row, and "Exclude from display" Then have the picture field be the last field so it can use the replacement patterns for all the other fields.

For the Picture options, "Hide if empty". "Rewrite the output of this field" and add the html and "Replacement patterns" for the all the fields in the Text box.


Yes, you need to add a filter to your view.

Add the filter User: Picture and for Has Avatar check "Yes", click update and save your view to see the changes. Users who don't have a profile picture will not show up in the view.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜