Posted by tejaspmehta on February 1, 2011 at 10:12am
Hello All,
I was building one theme based on fusion theme. Now all elements are set properly. Now i have created a view which is displayed in block. View display images of particular node if that node has image in CCK filed. So i created view with argument as Node:nid and Provide default argument and Node ID from URL. This works fine for all those nodes which have images. But when any node do not have any image at that time it should not display. But my problem is it is displaying. I have attached screen-shot of how it looks.
Any solution for this, to stop completely displaying off that block when there is no image for that node.
Thank you
Tejas Mehta
| Attachment | Size |
|---|---|
| Screenshot-1.png | 8.61 KB |
Comments
try this: go to view/edit :
try this:
go to view/edit : you should have Row style : Fields click on the config button and click the Hide empty fields
i have already set Hide this
i have already set Hide this field if Empty. And also applied your solution but still no result. It display same as like previous.
In your Filters, for the
In your Filters, for the image in CCK field, select 'Is not empty (NOT NULL)'
This is the correct answer.
This is the correct answer.
yes this is true forgot i
yes this is true forgot i have used it
Thanks
The filters suggestion worked great, thank you. For the others, selecting "is not empty" only appeared on my Drupal 7 site, not my Drupal 6 site. Drupal 6 only offered a True/False filter.
Dan Moriarty
www.electriccitizen.com
Yep :)
That worked for me :) Thanks!
try hiding the block using
try hiding the block using blockname.tpl.php if it has not passed all the requirements. Ideally this is not the method to be followed.
Hello thecodecutter, I
Hello thecodecutter,
I appreciate your answer but i do not get any such option in my filter.
When i added "Configure filter Content: Image (field_right_image_cck) - list" it asked me 2 options only. True and False. Nothing else as per your description.
Also it shows as -list instead of simple value.
Any other solution ? Also i can not use method of blockname.tpl.php which is suggested by f4k1r.
Thank you
Tejas Mehta
for example my filed is :
for example my filed is : (field_attach) - delta ( check the filter that has delta in the end)
Filtering 'is not empty (NOT
Filtering 'is not empty (NOT NULL)' on the field's delta is problematic for fields with multiple values in that it can cause the view to replicate for each instance of the delta. For example, I set up an image gallery view that uses one image field, containing multiple possible values. Filtering the view on the image field's delta, using the 'is not empty (NOT NULL)' operator causes the view to duplicate for each image in the field. (So if there are five images in the gallery, five copies of the view get displayed.)
I don't know if this is the best way to address this or not, but I solved the problem by filtering the field delta on 'is equal to' 0, because presumably in a multi-value field, there will always be a delta value of 0 somewhere in the array if there is data in the field.
Again, I don't know if my understanding of how the field delta works is spot on or not, but this solutions works.
Works!
Thanks, this worked for me for multi-valued fields "filtering the field delta on 'is equal to' 0."
-delta field are
-delta field are node-reference fields. I have Image field already set in my cck with name right_image. Its not showing in - delta.
Similar issue
I've seen a similar issue which at first I attributed to Context. Since then, however, I've tried this on several sites, using different themes etc. Each time I get the block printed even when it has no values. If it has a title that is printed otherwise just the empty block structure.
This block displays fine on nodes with taxonomy terms, however viewing a node with no terms assigned (and no records in the node_term table) displays the block title. This is displayed even in the preview without going to a page.
(Seems this should probably be an issue but posting here first in case anyone has feedback first)
--
Blog: Joshua Brauer dot com
Cool thanks - using a filter
Cool thanks - using a filter for the field worked.
BTW I got this to work in D6 using the content: My Photo - list true filter. I have "list field" disabled on the image file field, but it still seems to return true if there is an image present on the node, and not if there was no file uploaded.
Yea, in D6 for whatever
Yea, in D6 for whatever reason it to list true instead of a data is not empty filter. Just wanted to agree.