Hiding empty fields in details page

domenico

New member
I would like to hide all the empty fields in details page. Is it possible? On my site I run Dadabik version v.4.0 beta 2.
Thanks, Domenico
 

DebbieS

DaDaBIK Guru
I seem to remember a post some time ago about this sort of thing -- you'd have to search through the forums for the post(s).

 

marbour

Member
Hola Domenico

in business_logic, in function build_details_table)...
[pre]
right under:
$field_to_display = get_field_correct_displaying($field_values_ar[$j], $fields_labels_ar[$i]["type_field"], $fields_labels_ar[$i]["content_field"], $fields_labels_ar[$i]["separator_field"], "details_table"); // get the correct display mode for the field

modify if condition for:
if ( (($show_label_of_an_empty_field==0) && (strlen($field_to_display)>0)) or ($show_label_of_an_empty_field==1) ) {

and add:
// display the label of an empty field in the details view
$show_label_of_an_empty_field = 0; // values 0 = no and 1 = yes
to your config.php
[/pre]
Hope it helps

 

dmdecalonne

New member
It's a big bump from 2006, but I've got the same question in 2019 and the solution above does not work anymore (can't edit the business_logic-file anymore).

Is there another way to do this in DaDaBik 9.3?
 

eugenio

Administrator
Staff member
Hi,
at the moment there isn't a solution for that, I am not even sure that this simple and old solution can work anyway, DaDaBIK's code is more complicated now than it was in 2006.

Best,
 

larryk

Well-known member
Hi,
Is this situation still the same?
There isn't a way to hide an empty field?

I think there is a big need for this option:

when a user is viewing an edit page AND there is only a need to change existing data... obviously, they see the field.
HOWEVER, where a field is empty, the viewer is NOT allowed to enter data, they should NOT see the blank field.
There isn't a point in even showing the empty field if the user can't enter data.

Having a simple option to: Hide field when empty seems VERY valid and needed?

thanks
 

eugenio

Administrator
Staff member
Please use https://dadabik.canny.io/feature-requests to suggest/vote for new features.

Best,
 
Top