TinyButStrong ForumTinyButStrong Forum in Englishhttp://www.tinybutstrong.com/
Re: Displaying chart data as numerical rather than percentage valueshttp://www.tinybutstrong.com/forum.php?msg_id=15655
So I run the following code:

'$CLIENT_NAME$' is still there as the chart title. Am I doing it correctly? I have tried unzipping the docx file first. I'm obviously targeting the Microsoft_Excel_Worksheet3.xlsx file which contains the data for the chart I am targeting.

There is not such a feature in TBS, but you can do it using a custom onformat function.
See http://www.tinybutstrong.com/manual.php#html_field_prm_onformat2017-04-01 01:23:50Re: I need help retrieving 3 dimensional arrays through subblocks of subblocks while referencing by array keyshttp://www.tinybutstrong.com/forum.php?msg_id=15602
Hi,

Of course this can be a bit complicated if such a template has to be designed by "Someone that is not expected to know anything more than HTML".
Bu for such cases, I usually give to the user a simple syntax for fields (for example "[IMAGE]", "[TITLE]", ....) and when I load the template, just before doing the MergeBlock(), I do a str_replace()
to convert "[IMAGE]" into "[LIST2.BIO2.0.IMAGE]", and the same for other fields.
It's also simple to insert ";block=tr" for only one field when necessary.
And you can of course use the explicit syntax instead. For example: [BIO_START] will be replaced with "[LIST2;block=begin]", and "[BIO_END]" with "[LIST2;block=end]"

For the desired result B, the template could be:
[code]
<div>[LIST2.BIO2.0.TITLE]<br>
[LIST2.BIO2.0.PARAGRAPHS]
</div>
[/code]2017-03-13 22:53:16Re: Header on docxhttp://www.tinybutstrong.com/forum.php?msg_id=15592
> 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_header2017-03-11 23:42:49Re: Display as Tagshttp://www.tinybutstrong.com/forum.php?msg_id=15579
Some Db Engines have an aggregate function that concatenates strings. Like GROUP_CONCAT() in MySQL.
With such a function the solution is in your query.

Otherwise you can use TBS sub-blocks.2017-02-27 22:54:55Re: Nested blocks?http://www.tinybutstrong.com/forum.php?msg_id=15578
I think there is no need to have a sub block.
You simply have to merge BB first, then AA. So BB will be repeated for each row of AA.

For selecting the correct items in the combo-boxes, I can use 2 technical:
First is a dedicated plugins: http://www.tinybutstrong.com/plugins.php?help#plugin_html
The second is using JavaScript.2017-02-27 22:23:52Re: catch error messages before it reaches clienthttp://www.tinybutstrong.com/forum.php?msg_id=15571
Hi,

TBS has no common error handler for now because of history reasons.
BUt there a solution: if you set « TBS->SetOptions('noerr', true) », then no error message is displayed, the number of error is given by « $TBS->ErrCount » and the errors messages are given by « $TBS->ErrMsg ».
So you can check at the end of the merge if there is any error.2017-02-17 08:46:42Re: Wrong order of template content after show ?!?http://www.tinybutstrong.com/forum.php?msg_id=15569
Hi Fabrizio,

The point is that your function getInclude() should not drive the template. It should only return the result of the content for the field.
So there should be no « $app["TBS"]->Source.=$c; » nor « $app["TBS"]->LoadTemplate(null); ».
The double content you've got is because of that: inserted once by the function, and once by TBS.

For inserting your JS ans CSS contents, did you try with TBS sub-templates ?
Something like this :
[code]<script type="text/javascript">[include.js;file=[val];magnet=script]</script>[/code]
This will insert the sub-template, merge [onload] fields in the sub-template. It will delete the <script> entity if value of "js" is empty, thanks to parameter "magnet".

If you actually need to drive the merging of sub-template, then it is better to use parameter "onformat" with parameter "subtpl".
This enables you to call a PHP function where the scope of TBS is only for the sub-template.

2017-02-16 09:39:19Re: Include Javascript file with TBS fieldshttp://www.tinybutstrong.com/forum.php?msg_id=15568
I refactored my code, and now it works. But I have instead a problem of the order in which the included files are presented.

So I've opened another thread, because the problem is very different: http://www.tinybutstrong.com/forum.php?thr=3741

Still, is someone have a good idea other than mine....2017-02-13 15:08:03Re: Using class method as MergeField functionhttp://www.tinybutstrong.com/forum.php?msg_id=15557
Thank you!!!!2017-02-07 10:29:33Re: the key 'pagetitle' does not exist or is not set in VarRefhttp://www.tinybutstrong.com/forum.php?msg_id=15548
Maybe you should write one, Skrol ;)2017-02-04 12:43:33Re: TBS with PDF?http://www.tinybutstrong.com/forum.php?msg_id=15547
I'd suggest you create 3 html templates, one for header, one for footer and one for the main content, and then convert it with wkhtmltopdf.2017-02-04 12:40:17Re: Variables are not changedhttp://www.tinybutstrong.com/forum.php?msg_id=15539
I resolved!
Fir personal template need exec $TBS->PlugIn(OPENTBS_SELECT_SHEET, 1) after load template. 2017-01-19 15:40:21Re: How to get all blocks from template? http://www.tinybutstrong.com/forum.php?msg_id=15537
Hi,

This feature does not exists. You have to search them yourself in the source of the template : $TBS->Source.

TBS cannot do it for now because TBS fields can be build dynamically.2017-01-18 23:48:38Re: List all field from a templatehttp://www.tinybutstrong.com/forum.php?msg_id=15528
Hi,

There is no such feature in native.
This is because a field can also be build dynamically (like in dynamics columns for example).
But you can try to get all static fields simply with a regexp on the template, I guess.2017-01-09 10:15:52