Hide a row or module when a field connection is empty (Themer)
There may be times when you don't want entire rows or modules to show up when a field connection is empty.
Tip: If you don't need to hide entire rows or modules, you can use conditional shortcodes instead of PHP code to display field connections only when they return content. See the Related Articles for more information.
You can use the following code to hide rows or modules that have empty field connections. Add it to your child theme's functions.php file.
Note: This code is just a starting point and will not work in every situation. Use your knowledge of PHP to extend this code, using the
$node variable to choose which rows or modules are hidden based on a number of circumstances such as