Capture - how does it work?

Hello,

I’m kind of confused as to how the capture tag works. It seems to me as if it actually is just “fancy” copy paste. Which is fine for some things.
image
In the above case i would expect my template to print out First value, then Second Value. But that is not the case, instead i get this
image

It seems like the capture keeps the state that it has when it is initially created, is that correct ? Why does it not use my up to date variables ?

Another weird example of this is, if you create a capture like the following
image
Here you would expect that the text presented would be the english translation, but it isnt.
image
The above kind of disproves that it is infact a copy paste. Since if it was, it would just run the localization logic and determine in this context, that the current language is infact en. I also know that in order to make the above work, you could just move the locale tag into the capture block.

Is it then because we run the template from top to bottom, and whatever state the code is in when it hits the capture, is then what is saved as a string ? If that is the case - i highly suggest you update your documentation.

Hi @Oliver_R_DK

Thank you for your question.

Is it then because we run the template from top to bottom, and whatever state the code is in when it hits the capture, is then what is saved as a string ? If that is the case - i highly suggest you update your documentation.

It is indeed the case that what you enter between the capture tags is stored as a string.
You can use this value, or a piece of code, further in the templates you are building.

For example a table definition that is used multiple times in the template can be stored within the capture tag and be recycled through the template.

Best regards
Robbe

Thanks for the quick response.