Basic Concepts


Each time BoltWire loads, it creates a markup table which determines the markups to look for and the order they are processed. This markup table can be modified however you want. Here's how it works.

Defining the Table

The markup rules used in BoltWire are all defined in the top portion of markups.php. Each line looks like the following:

MarkUp('vars', 'member', '/\{\~([^{}+=* ]+)\}/e', "BOLTMmemberVar('$1')");

The markup function (found in library.php) assigns each an "order" (vars), a specific "rule" (member), a pattern to match (the regular expression), and the output. In this case, {~field} is sent to the memberVar function to retrieve a members data value.

Note: If you are not familiar with regular expressions, there are many fine tutorials online. However, it is not an easy topic.

When markup is processed, it runs through the markup table in the order it was generated, completing all the rules within an order before moving on to the next order.

The basic order of the markups in BoltWire is as follows:

PRE escapes, comments, boxes
VARS all kinds of vars
FUNC math expression, var and regular functions
IF conditionals
FORM conditional functions and form inputs
SYMBOLS    html entities, spaces, indents, hr, etc
LINKS all kinds, including images and citations
BULLETS ordered and unordered lists
STYLE fonts, colors, alignments, etc, and some HTML
BLOCK headers, tables, and nolines

For a peek at the full markup table, scroll down to the bottom of this page.

Changing the Markups

You can add a new markup rule by simply defining it using the syntax above and placing it in config.php. Make sure you assign it to the order you want and choose a unique rule name. The processing order is very important and you may have to experiment a bit to get just the right spot in the markup table.

Normally when you add a new rule, it is appended to the end of the order you specify. You can assign it a more exact position by specifying the markup rule it should precede. So setting a new rule's order to 'pre' and the rule to '<boxes', inserts it just after comments and just before boxes. If you use a new order, your rule will be added to the very end of the markup table.

To disable a rule you do not want, simply put this line in config.php or a plugin:

Markup('order', 'rule', '');

To modify an existing rule, say to change the syntax of some markup or point the markup to a custom function, just redefine it...

Markup('order', 'rule', '/new pattern/', 'new output');

Skins and Markups

When BoltWire loads a skin it processes markup in the following order:

1) Code zones like <<css>> are inserted.

2) Inline markup is processed in the skin, ie: {somevar}

3) Each zone is retrieved one at a time and run through the entire markup table. That is, the header zone is completely processed before the footer zone begins.

4) Skin settings are processed next (vars like {slogan} found in code.settings).

5) Next, [messages] are output.

6) Finally, any values in the replacetable, are processed.

Special Considerations

Several markups call the markup table directly:

Content within <box> ... </box> is run through the entire markup table and then escaped. If you want to limit processing within the box to certain rules, set a rules parameter to a csv list of the orders and/or specific rules you want to process.

The include function run the content it retrieves through the markup table before it is returned to the page. You can set the base page for this content to the page it is drawn from by setting baselinks=true.

When a list or search function defines a parameter, each page runs the template through the entire markup table and then returns it escaped. Fmt's simply return the output to the page and allows any markup in it to be processed along with the rest of the page. This makes fmts faster, but templates more versatile.

Markup Table

Here's a look at the default markup table in BoltWire.