Hide elements label whan empty

Here's where I ask lots of questions...... :)

Is it just the label you want to hide or the actual element or both?

At what point do you want this hidden and is this for lists or forms?


You can do realtime hiding using javascript and \ or css but you can prevent it loading in the first place with PHP, assuming you don't want to unhide it for that session.
 
all these are valuable informations.
For the moment i need to do it for the list and forms. Show labels only when data is entered.

Thanks!
 
I m back to that, since I didn t understand the answer.
To be more precise.
How can I hide the label of an element in list view and preview (detailed preview not edit form), when the element isn t used in the row. For example I have an entry with no fax on it. So in the list or in the detail view, I don t want to see the label fax.
 
This in an Fabrik1 thread.

To hide empty elements in details view add
#details_$c .fabrikDataEmpty {display:none}
to custom_css.php
 
CSS Solution in your Custom Fabrik template or Custom.CSS

Code:
.fabrikDataEmpty {
    display: none!important;


}
PHP Solution


Edit default_group.php on a 'COPIED' template.

Change:-

Code:
<?php foreach ($this->elements as $element) :
    if ($this->tipLocation == 'above') :?>
to

Code:
<?php

[B][COLOR=Red]$skipelements = array('listname___elementname1','listname___elementname2');[/COLOR][/B]


 foreach ($this->elements as $element) :
        foreach($skipelements as $skipelement) :
            if(strpos($element->id, $skipelement) === false) :
             continue; 
            endif;
        continue 2;
    endforeach;

    if ($this->tipLocation == 'above') :?>
Single Groups

Use full list__elementname as shown below.

$skipelements = array('listname___elementname1','listname___elementname2');

Repeat Groups


Use Join id's with the end numbers...

$skipelements = array('join___123___listname___elementname1_ro_','join___123___listname___elementname2_ro_');
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top