Hi,
I have need for a particular functionality in my site and would appreciate some guidance implementing it. Hopefully you will consider including a patch in your module too.
The Use case: I would like to have "Product Videos" as a content type in Drupal. Each Product Video will reference a product and on the "Product" content type node page you will see in the right column a list of videos that you can watch. If there are no product videos associated with the current Product then there will be no right column.
As you can see this is a perfect usage for Node Referrer (and i love the module btw!). I'm implementing the display section of this as a View Block that will be added to the right column. Easy enough and I've worked out how to get the right videos showing up correctly. The problem is the requirement: "if there are no product videos then there will be no right column"
Please see attached screenshot and exported view for how i have setup my view. Essencially what I'm doing is i have a filter on node type set to "Product" so this view will not return any results on any other node type. And the output will be the node referrer field of the current product.
The problem lies in the fact that Drupal will only hide this block if the result from the Views Filter returns no nodes and not if the content of the output is empty. If there are no Product Videos for this Product then the content of this block will be empty (because there are not node referrer entries) but the results of the views filter will still return the current node. I want to be able to filter based on the Count of the array of node referrer entries (the most flexible implementation i think) so that i will only show the block if there are more than 0 entries in that field.
I am looking into how to extend your nodereferrer_view_handler_filter.inc code and would appreciate if someone could point me to any tutorials or reference material for this.
Thank you
| Comment | File | Size | Author |
|---|---|---|---|
| view_product_videos.txt | 3.55 KB | real_ate | |
| view_product_videos.png | 62.24 KB | real_ate |