Search the Community
Showing results for tags 'skiplabel'.
-
Hi forum, I have this list of fields with labels and I want to skip the displaying of labels for fields left empty (e.g. if field "logo" is not filled with an image, but it could also be text fields). Using count() and "continue" will always output either nothing or all labels. Is there a way to use the "skipLabel" method in the loop? foreach ($page->template->fields as $field) { if(!count($page->$field->logo)) {continue;} else { $etikette = $field->getLabel(); //get label in the current user language $content .= " <br><li class='pub-field'>$etikette<br> </li>"; //display labels as li $content .= $page->get($field->name) . "<br>"; // display values as li } } Thanks for your help!
-
Could someone help me out a little? Thank you! Following code does not remove the label at all, but I can't seem to find the reason why. (I have tried skipLabelBlank too, same result) // create a checkbox $field = $modules->get("InputfieldCheckbox"); $field->attr('id+name','test'); $field->label = ''; $field->skipLabel = Inputfield::skipLabelHeader; // DOES NOTHING? $form->add($field); ps: I'm using PW 3.x