3. Static Blocks

Sometimes re-expansion of embedded BML might not be what you want. In that case, you can designate a block with a flag that will cause it to stop or limit the re-expansion of embedded calls.

3.1. Fully-Static Blocks

If you add the {S} flag to the block you're defining, the contents of it will not be re-evaluated afterwards. This is useful mainly when you have blocks you are sure will never contain BML to be expanded or properties to fill in, and you want to save the overhead of trying to re-evaluate them.

Example 1.14. Look file with {S} block

companyname=>{S}Acme, Inc.

This defines the companyname block as static.

Example 1.15. BML file that calls the static block

<h1>Welcome to <?companyname companyname?></h1>

Combining the two yields:

Example 1.16. Example output

<h1>Welcome to Acme, Inc.</h1>

3.2. Semi-static Blocks

Sometimes you want a block which fits somewhere between the fully-dynamic {D} blocks and the completely-static behavior of {S} blocks. Enter the {R} block flag. It expands pRoperties like those passed to a {D}, {F}, or {P} block, but doesn't expand BML that might be inserted by one of those.

Example 1.17. Look file with {R} block


Example 1.18. BML file


Example 1.19. Example output