Hide element if not selected in pdf Details view

ontarget

Active Member
Hi,
Using F4 Zeta
How can I hide a dropdown element from the pdf view if it's not being selected by the user or has a value of 0?
Would I edit /components/com_fabrik/views/details/tmpl/bootstrap/default.php
with something like:
$group_name = $this->groups['myList'];
$elements = $group_name->elements;
$coursedd = $elements ['aaa_reg_list2___course_dd_raw']->element;
if ($coursedd == 0){
echo " ";
}
else{
echo $coursedd;
}

Or would i have to do a completely new default.php file echoing all elements that i need to show / hide (in my case I only need to hide 1 element out of about 100) so hopefully i can edit the existing default.php file
Thanks for any pointers
 
You should not edit a core Fabrik template, it will be overriden by the next update.

Create a custom template, just copy the /bootstrap folder to e.g. /bootstrap_pdf

Then edit default_group.php, in the foreach loop set the element string $element->element (if you want to display still the label) or
displayData['row'] for your special case.

BTW: I think dropdown values are usually strings so don't do ==0
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top