Hello,
I use Views for creating blocks.
Each block has an argument provided by the the node (ID).
Each block has exeptions and title managed by the block page (admin/structure/block)
My problem (photo enclosed):
If the view doesn't returns data, the title is still there. I try to put the title in the view title, I try to create a text field in the header of the view too, it's always the same.
If I put in "Behavior in the absence of results" any kind of informations, they are never displayed. It's seems that the view consider that there's always data returns....
Can you help?
| Comment | File | Size | Author |
|---|---|---|---|
| view-title.jpg | 27.99 KB | zorax |
Comments
Comment #1
dawehnerFirst take sure that there is really no data in the result, there could be always some empty rows.
Comment #2
zoraxThat it, I just add a filter field (content is not null), and the block is removed !
Thank's a lot!
Comment #3
dawehnerCool!
Comment #4
zoraxHi,
I reopen this post because the subject is very close.
in the last print dev version (7.2 dev) there's a problem to get view content .
I used this function for displaying the view in a tpl file :
print views_embed_view('page_actu', 'block', $node->nid)but I can't have the title displayed.
So I create a function for displaying content AND title in template file :
When I call this function there's always title displayed even if the page don't have a view result.
So I'm looking for a conditionnal customisation code to avoid. here
if (!empty($view->result), or if ($view->render()) {doesn't works...thanks
Comment #5.0
(not verified) commentedBehavior in the absence of results