Categories > TinyButStrong general >

onload file with block.

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Romulo
Date: 2013-02-27
Time: 15:50

onload file with block.

Hello, my code below return this error and do not know what else to do, I need help are already 2 days without a solution.

Thank you!

[blk_access_conta;block=begin;p1=[blk_menu_opcao.sigla_do_sistema]]
    [onload;file='html/[blk_access_conta.TOTAL_MENU].html']
[blk_access_conta;block=end]

Error MSG:

TinyButStrong Error in field [onload...]: the file 'html/[blk_access_conta.TOTAL_MENU].html' given by parameter script is not found or not readable. This message can be cancelled using parameter 'noerr'.
By: Sarah
Date: 2013-02-27
Time: 20:09

Re: onload file with block.

It looks like your [onload...] tag is being processed "onload", meaning, prior to the block merge command. Change this to 'onshow' if you want [blk_access_conta.TOTAL_MENU] to merge in time to be used by
[onshow;file='html/[blk_access_conta.TOTAL_MENU].html']
By: Romulo
Date: 2013-02-27
Time: 20:57

Re: onload file with block.

The file has html code when I put the tbs OnShow it displays the contents and not run variables. He had run this solution. Thanks but I'm still looking.
By: Sarah
Date: 2013-02-27
Time: 21:05

Re: onload file with block.

Perhaps you could try:

[blk_access_conta.TOTAL_MENU;file='html/[val].html']

Assuming you aren't using the blk_access_conta block inside the subtemplate.

Untested.
By: Romulo
Date: 2013-02-28
Time: 13:02

Re: onload file with block.

equal to onshow.

when I write this:

[onload;file=html/1.html]

works perfect.


however the file changes according to the return of the bank.
By: Sarah
Date: 2013-02-28
Time: 17:14

Re: onload file with block.

Do you mean you get the same results with the code I gave as you get using onshow?

I tested my code today and it works as expected. Are you merging blk_access_conta with a $TBS->MergeBlock('blk_access_conta', $variableName) call in your PHP?

You will not be able to use onload for this if you want block data to determine the name of your subtemplates. Blocks are not merged before the template is loaded.
By: Romulo
Date: 2013-02-28
Time: 17:36

Re: onload file with block.

but I can see work 100% if I write the onload direct.

By: Romulo
Date: 2013-02-28
Time: 17:38

Re: onload file with block.

works well

[onload;file=html/1.html]

below do not form
[blk_access_conta.TOTAL_MENU;file='html/[val].html']

Error MSG:

TinyButStrong Error in field [onload...]: the file 'html/[blk_access_conta.TOTAL_MENU].html' given by parameter script is not found or not readable. This message can be cancelled using parameter 'noerr'.
By: Sarah
Date: 2013-02-28
Time: 17:45

Re: onload file with block.

I realize it works when you use [onload;file=html/1.html] - this is valid. However, if you use [onload;file='html/[blk_access_conta.TOTAL_MENU].html'] it will always result in file='html/[blk_access_conta.TOTAL_MENU].html' and you will get the error you are showing:

TinyButStrong Error in field [onload...]: the file 'html/[blk_access_conta.TOTAL_MENU].html' given by parameter script is not found or not readable. This message can be cancelled using parameter 'noerr'.

...because there is no file called 'html/[blk_access_conta.TOTAL_MENU].html' on your server. If you want [blk_access_conta.TOTAL_MENU] to turn into '1', you cannot put it inside an [onload] tag. Which is why I suggested you try:

[blk_access_conta.TOTAL_MENU;file='html/[val].html']

Which will not give you the error you are showing. It cannot, because there is no [onload] tag to produce this error. If you are still getting the error you are showing after switching my code for yours, then there is another location in one of your files that still contains your old code which is causing the error.