VI. Appendices

[ Previous: B. Rule Parameters | Next: D. Template Flags ]

C. Content Classes

Content classes control which tags are allowed to nest within others and which are not: If a tag is not allowed to nest inside the current class, it will be treated as plain text instead of as a tag. You can define your own classes depending on your needs, but the most common classes are as follows:

  • block: A rectangular block of text, equivalent to the CSS display:block property. This is generally an outer containing class.
    Usually contained by: Blocks, list items, columns.
    Can usually contain: Blocks, inlines, links, lists, columns, images, code

  • inline: A span of text with an unusual property, like italics or boldface or a color change. This is generally an innermost class: Most other tags can't go inside it, with some exceptions.
    Usually contained by: Blocks, list items, columns, links, inlines.
    Can usually contain: Inlines, links, images.

  • link: A span of text that is a clickable link to somewhere. Links usually cannot be placed inside other links.
    Usually contained by: Blocks, list items, columns, inlines.
    Can usually contain: Inlines, images.

  • list: A block-like region that may only contain list items.
    Usually contained by: Blocks, list items, columns.
    Can usually contain: List items.

  • listitem: A single item in a list, this is a block-like region that can contain just about anything else.
    Usually contained by: Lists.
    Can usually contain: Blocks, inlines, links, lists, columns, images, code

  • columns: A block-like region that may contain multiple parallel columns of blocks within it.
    Usually contained by: Blocks, list items, columns.
    Can usually contain: Blocks, inlines, links, lists, columns, images, code

  • nextcol: An infinitely small class (with no content) designed to separate columns of a column group.
    Usually contained by: Columns.
    Can usually contain: (nothing; has no body)

  • image: An inline text-like object that is replaced with external content.
    Usually contained by: Blocks, inlines, links, list items, columns, code.
    Can usually contain: (nothing; has no body)

  • code: A block-like region that reproduces its contents exactly.
    Usually contained by: Blocks, list items, columns.
    Can usually contain: (nothing; body is verbatim)

So the standard class containers are related like this:

Can be placed within this class*:
blockinlinelinklistlistitemcolumnscode
Tag
of
class:
block Yes. . . Yes. .
inline YesYesYes. Yes. .
link YesYes. . Yes. .
list Yes. . . Yes. .
listitem . . . Yes. . .
columns Yes. . . Yes. .
nextcol . . . . . Yes.
image YesYesYes. YesYes.
code Yes. . . YesYes.
Special
content:
[plaintext]YesYesYes. YesYesYes
[smileys] YesYesYes. YesYes.
[rules] Yes. . . YesYes.

* Note: In the list of possible containers, the nextcol and image classes are omitted because they cannot contain any content.

The initial container class that wraps around the entire input document is "block" by default; however, this can be changed at runtime with the BBCode::SetRoot family of functions.

[ Previous: B. Rule Parameters | Next: D. Template Flags ]


Copyright © 2010, the Phantom Inker. All rights reserved.