BML is essentially a simple macro language. Macros are called templates in BML. Templates are defined in lookup files and are invoked in BML files. Templates accept parameters and are divided into several types according to how parameters are transmitted and how the definition of the template is able to make use of them. Definitions of templates are essentially chunks of HTML with potentially more recursive BML template invocations inside them.
For LiveJournal, the most common templates are defined in the file
; all other
schemes either replace all of the templates, or inherit whichever
is not replaced.
$/cgi-bin/bml/scheme/global.lookLJHOME
To write your own scheme, all you have to do is write your own
BML lookup file that uses the same templates
as .
Then, implementing a new scheme becomes pretty painless:$/cgi-bin/bml/global.lookLJHOME
Procedure 20.1. Creating a new BML scheme: foo:
Create a new file under ,
labeled after the scheme name ($/cgi-bin/bml/schemeLJHOMEfoo). For example:
.
This file should contain all of the BML directives you have written for your unique layout.
The first line in this file should be $/cgi-bin/bml/scheme/LJHOMEfoo.look
_parent=>global.look
If you don't have a local BML configuration file (_config-local.bml)
in your directory, you should create one now.
The contents of that file should look like:
$/htdocsLJHOME
Manually restart the Apache process.
After you have written your scheme, consider adding it to the array in @LJ::SCHEMES, so that
your users can use their preferred scheme. You can also add a thumbnail preview image of your front page
into htdocs/img/schemethumb, and link to it from that array.