Categories > TinyButStrong general >

Header on docx

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: lena
Date: 2017-01-10
Time: 14:22

Header on docx

Hi

I do not understand why tags not work in headers in DOCX. I am working with symfony. I found the advice to include plugin: $TBS->PlugIn(OPENTBS_SELECT_HEADER, [$Type[, $Offset]).
Firstly i become the mistake about brackets ($TBS->PlugIn(OPENTBS_SELECT_HEADER, [$Type[, $Offset])  - here is not closed bracket). If i make so:

$TBS->PlugIn(OPENTBS_SELECT_HEADER, [OPENTBS_EVEN]);
or
$TBS->PlugIn(OPENTBS_SELECT_HEADER, [OPENTBS_DEFAULT ]);

only tags from header are changed, other tags stay the same.  Could you advice me something?
  
                               
By: Skrol29
Date: 2017-01-10
Time: 14:25

Re: Header on docx

Hi,

Brackets are usual syntax for meaning optional arguments in a function's synopsis.
See for example: http://php.net/manual/en/function.strpos.php

The correct snippet is
$TBS->PlugIn(OPENTBS_SELECT_HEADER, OPENTBS_EVEN)
By: lena
Date: 2017-01-10
Time: 14:51

Re: Header on docx

Skrol29, thank you very much for the answer, but this does not work. I become not mistakes, but with OPENTBS_EVEN header does not work and with OPENTBS_DEFAULT other tags do not work. I can attach a document, but do not see how.
By: Skrol29
Date: 2017-01-11
Time: 09:34

Re: Header on docx

Automatic fields [onload] and [onshow] are automatically merged in headers and footers.
For other fields or blocks you have to open an header/footer, to your merge on it, then load another header/footer and do the merge on it, and so one.
You have only one current selected sub-file at a time. MergeBlock() and MergeField() are working only on the current selected sub-file.
By: lena
Date: 2017-03-08
Time: 14:53

Re: Header on docx

Thank you for the answer))

sorry, but i do not understand the phrase: "For other fields or blocks you have to open an header/footer, to your merge on it, then load another header/footer and do the merge on it, and so one" How can i open an header? I have headers in the pages, how can i attach these headers to the blocks?  This plugins do not work. Maybe you have an example, where can i see this?) And in odt format does not work too

By: Skrol29
Date: 2017-03-11
Time: 23:42

Re: Header on docx

> How can i open an header?

In Ms Word, you can see and edit the header directly within the application. But in backstage the main content of the document is saved in a sub-file and the header is saved in another sub-file.
OpenTBS can merge data in one sub-file at a time. By default, the main sub-file is loaded.

> I have headers in the pages, how can i attach these headers to the blocks?

In the template, enter a block definition as usual.
At The Php side, use the command OPENTBS_SELECT_HEADER in order to load the header sub-file as current.
See
http://www.tinybutstrong.com/opentbs.php?doc#opentbs_select_header