9 Posts
schekutiev
8 years ago
2
Topic

Hi!

Is it possible to make a condition to display Content field depends on the List & Search Type result? I need to display one field when the search returns a result and hide it (show another field) if the search returns no results. I tried to do this by specifying the search result in the list plugin field and conditions, but did not get the desired effect. Is it possible to add a condition, when the search return no results?

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
1
Level 1

There is no built-in way to do this - could only be done with some custom javascript that would check if there is some content in the list (I presume you are using Seblod list field to show it) and then hide on of the field depending on the result.

9 Posts
schekutiev
8 years ago
0
Level 2

Klas, thank you for the answer. It seems that the question is solved.

<script type="text/javascript"> 

(function($) 

{ $(function () {

if( $('.cck_module_list').children().is(':empty') ) {

// do

}

});

})(jQuery); 

</script>

Get a Book for SEBLOD