dadabik_field in *_header.html

prettem

Member
Hello,
is there a possibility to have a custom title, depending on a dadabik_field in a custom pdf in tabular mode?
I put a field name in the *_header.html but it does not work.

best regards
Manuel

1664997118518.png

Your current DaDaBIK version​

You are using DaDaBIK version 11.7-Elba enterprise, installed on 03.10.2022 (installation code: 18260633b0f37e7bc0), the latest version of DaDaBIK is 11.7-Elba released on 18.08.2022

You are running the latest release of DaDaBIK

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.

System info​

PHP Version: 7.4.16

mysql version: 5.7.33-0ubuntu0.16.04.1

Web server: nginx/1.18.0

Client: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 OPR/90.0.4480.84
 

prettem

Member
yes titel is the field name, if I put titel in my Vokabel-Wh.html (not Vokabel-Wh_header.html) it works

<!-- DaDaBIK Template -->
<tr><td>dadabik_field wort dadabik_field</td>dadabik_field titel dadabik_field<td></td><td></td></tr>
 

eugenio

Administrator
Staff member
Ok sorry I missed the fact that it was in the header template. Fields are not parsed in header/footer html template.
You should create a PHP header template, so that you can add custom PHP code.
I haven't tested it but you should be able to access to the value, for the field fieldname and the current record, using:

PHP:
$res_details['fieldname']

Best,
 

prettem

Member
unfortunately it produces an blank output, thats my Vokabel-Wh_header.php

<!-- DaDaBIK Template -->
<html lang="de">
<head>
<meta charset="utf-8" />
</head>

<body>

<h1><?php echo $res_details['titel']; ?></h1>

<table style="border-collapse: collapse; width: 80%;" border="0">
<thead>
<tr>
<th style="width: 50%;">Name:</th>
<th style="width: 20%;">Klasse:</th>
<th style="width: 20%;">Datum: <?php echo $res_details['datum']; ?></th>
<th style="width: 20%;">Gruppe:<?php echo $res_details['gruppe']; ?> </th>
</tr>
</thead>
</table>
<p>&nbsp;</p>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 30.3202%; text-align: center;">Vokabel</td>
<td style="width: 30.3202%; text-align: center;">&Uuml;bersetzung</td>
<td style="width: 30.3289%; text-align: center;">Erg&auml;nzungen</td>
</tr>
</tbody>
 

prettem

Member
one more question please, do I use this statement correct <?php echo $res_details['titel']; ?> in _header.php?
What is the origin of $res_details? when and where it is set? why its empty at this position? I cannot find anything in documentation concerning this topic.

many thanks
Manuel
 
Top