HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Tutorial: Advanced themeing

Written by Philip Withnall, ocProducts
ocPortal's themeing system has the power and flexibility to enable you to make your site look like anything you want, but such feats require thorough knowledge of Tempcode, and the layout of ocPortal's templates and other theme-related files. The basics of Tempcode programming are covered in the Tempcode tutorial; this topic covers the primary templates, classes, symbols and directives in ocPortal.


Primary templates

BASIC_HTML_WRAP

BASIC_HTML_WRAP is used for stand-alone outputted pages, such as the uninstaller, banners (for iframes) and author lists. It contains only basic markup with no styling, and accepts the following parameters:
  • TARGET: a target for the <base /> element
  • TITLE*: the page title (will be HTML-escaped)
  • CONTENT: the page content

BOTTOM

BOTTOM is used for the bottom bar on every page. Due to the lack of complex CSS support in certain browsers, the bottom bar has to be vertically placed through Javascript, and thus it is imperative that any IDs in this template are left untouched unless the Javascript is modified. It accepts the following parameter:
  • FLAGRANT: the current flagrant text message

COMCODE_PAGE

COMCODE_PAGE is the wrapper for any Comcode page. Most of the markup in this template is for administrative purposes only, but you can add your own markup to change the appearance of Comcode pages. It accepts the following parameters:
  • WARNING_DETAILS: any warning to be displayed on the Comcode page
  • CONTENT: the actual page content, parsed from the Comcode
  • SHOW_AS_EDIT: a boolean value for whether to show the last date the Comcode page was edited
  • EDIT_DATE_RAW: the raw date (i.e. timestamp) at which the page was last edited (it is normally converted to a pretty date using the {$DATE,...} Tempcode function)
  • EDIT_URL*: the URL where the Comcode page can be edited (will be HTML-escaped)
  • NAME*: the name of the Comcode page (will be HTML-escaped)

DO_NEXT_ITEM

DO_NEXT_ITEM is the template containing a single do-next option (i.e. a single table cell) for display in a do-next section. Unfortunately, all do-next templates have to use layout tables, due to the fact that neither the height or the width of anything in the cells is known. This template accepts the following parameters:
  • I: the number of the cell in the section; this is used in Tempcode logic to end rows and start new ones
  • DOC: the hover-over help documentation for this item
  • LINK*: the URL to which to link (will be HTML-escaped)
  • DESCRIPTION: the description for the item (will be HTML-escaped)
  • PICTURE*: the name of the picture to use (will be HTML-escaped)

DO_NEXT_PAGE

DO_NEXT_PAGE is the template to wrap around a page containing only a do-next section. It contains the Javascript needed for the hover-over help documentation for do-next items and an introductory paragraph. It accepts the following parameters:
  • TITLE: the title of the page
  • QUESTION*: the question/introductory paragraph to show (will be HTML-escaped)
  • SECTIONS: the do-next section

DO_NEXT_SECTION

DO_NEXT_SECTION is the template which contains most of the markup for do-next sections. It has the layout table and padding Tempcode logic (adding empty table cells if a row isn't complete), and it accepts the following parameters:
  • TITLE: the title to display in the little bar at the top of the do-next section
  • CONTENT: the items to display in the do-next section
  • I: the number of the last item in CONTENT

FOOTER

FOOTER holds the markup for actually closing the page (i.e. the </html>). The BOTTOM and FOOTER templates are split up as they are so that some pages can be sent without the bottom bar. This template accepts the following parameter:
  • BOTTOM: whatever content should be displayed at the bottom of the page; typically the contents of the BOTTOM template

FORM

FORM wraps almost every form in the system (apart from a few special cases such as the shoutbox and OcCLE). It provides Javascript input validation, warnings about required fields and an introduction. There are many template related to forms in ocPortal, and they all begin with "FORM_"; there isn't room to list or describe them here, but if you're completely reskinning ocPortal you might want to take a look at them. This template accepts the following parameters:
  • TEXT: the introductory or explanatory text to display at the top of the form
  • REQUIRED_NOTICE: a boolean value for whether to show the "required fields" notice
  • POST_URL*: the URL to which the form contents will be posted
  • HIDDEN: the hidden fields
  • FIELDS: the fields to display
  • SKIPPABLE: if passed, the form will be skippable, and the value of this parameter will be used as a unique identifier

FORM_PAGE

FORM_PAGE is used instead of the normal FORM template if the form's the only thing on the page. It accepts the following parameters:
  • TITLE: the page title
  • WARNING_DETAILS: any warning to be displayed on the page
  • TEXT: the introductory or explanatory text to display at the top of the page
  • SKIP_REQUIRED_NOTICE: a boolean value for whether to skip the "required fields" notice (note that this is the converse of the REQUIRED_NOTICE parameter for the FORM template)
  • IFRAME_URL*: the URL to which to submit the form contents if using the iframe results system; don't pass it if you want to submit the form normally (will be HTML-escaped)
  • POST_URL*: the URL to which to submit the form contents if submitting the form normally (will be HTML-escaped)
  • HIDDEN: the hidden fields
  • FIELDS: the fields to display
  • SKIPPABLE: if passed, the form will be skippable, and the value of this parameter will be used as a unique identifier

FORM_PAGE_FIELD

FORM_PAGE_FIELD is a generic wrapper for fields in a form. It is provided with a specific input element (such as a textbox or checkbox), and wraps it with the label, description, required warnings, and so forth. It accepts the following parameters:
  • BORING_NAME*: the name with which the input is referred to; it has to be a valid ID (will be HTML-escaped)
  • NAME*: the human-readable name for the form field, displayed as the label (will be HTML-escaped)
  • REQUIRED: a boolean value specifying whether the field is required
  • COMCODE: the markup for the Comcode link to display, if appropriate
  • SKIP_LABEL: a boolean value specifying whether to skip the hidden accessibility label
  • DESCRIPTION: the description for the form field

GLOBAL

GLOBAL is the main template: it is used for all pages, and encompasses all other templates. It accepts the following parameters:
  • BREADCRUMBS: the breadcrumb trail for the top of the page
  • HELPER_PANEL_TUTORIAL*: URL to a tutorial on the current page (will be HTML-escaped)
  • HELPER_PANEL_PIC: the name of the image to display as the background to the helper panel
  • HELPER_PANEL_HTML: HTML to display in the helper panel
  • HELPER_PANEL_TEXT: text to display in the helper panel
  • MESSAGE_TOP: message to display at the top of the page
  • MIDDLE: the actual main page content
  • MESSAGE: message to display at the bottom of the page

GLOBAL_PRINTING

GLOBAL_PRINTING is used in place of GLOBAL when the user wants to print the page. It accepts the following parameters:
  • MIDDLE: the actual main page content

HEADER

HEADER is the template containing the opening markup for the page, including the DOCTYPE and XML header. It accepts the following parameters:
  • HEADER_TEXT*: the text to display as a secondary message in the browser titlebar (will be HTML-escaped)
  • DESCRIPTION*: the page's meta description (will be HTML-escaped)
  • KEYWORDS*: the page's meta keywords (will be HTML-escaped)
  • SELF_URL*: the page's URL (will be HTML-escaped)
  • CHARSET: the current charset
  • REFRESH: any meta refresh markup
  • TOP: the contents of the TOP template
  • DEFERRED_ERRORS: any deferred error messages (passed as a linear array)

INDEX_PAGE

INDEX_PAGE is a general-purpose page structuring template, providing for an introduction, content (a list of available actions), and a post-content section. It accepts the following parameters:
  • TITLE: the page title
  • PRE: the introduction section content
  • CONTENT: the main page content (typically a list of INDEX_PAGE_ENTRY templates for available actions)
  • POST: the post-content section content

INDEX_PAGE_ENTRY

INDEX_PAGE_ENTRY is one entry to be used in INDEX_PAGE. A list of INDEX_PAGE_ENTRY templates should be built up using attach, and used as the CONTENT parameter for INDEX_PAGE. It accepts the following parameters:
  • URL*: the URL of the action (will be HTML-escaped)
  • NAME*: the name for the link (will be HTML-escaped)

MAIL

MAIL is used as the HTML wrapper for e-mails sent by the system. It is fully styled and structured like a normal ocPortal page. It accepts the following parameters:
  • LANG*: the language in which the e-mail is being sent (will be HTML-escaped)
  • TITLE*: the title/subject matter of the e-mail (will be HTML-escaped)
  • CSS: the CSS to style the e-mail
  • LOGOMAP: the logo or imagemap for the site logo
  • CONTENT: the content of the e-mail

MEDBORDER_BOX

MEDBORDER_BOX is for a box with a medium border, similar to the STANDARDBOX. It accepts the following parameter:
  • CONTENT: the content to be displayed in the box

MESSAGE_PAGE

MESSAGE_PAGE is used to display a message to the user as a standalone page (e.g. a harmless message, not an error message). It accepts the following parameters:
  • TITLE: the page title
  • TEXT*: the text to display as the message (will be HTML-escaped)

MISTAKE_PAGE

MISTAKE_PAGE is used to display a page highlighting your mistake with a back button (e.g. a Comcode error page). It accepts the following parameters:
  • TITLE: the page title
  • TEXT*: the text to display as the message (will be HTML-escaped)

OCF_FORUM

OCF_FORUM wraps around a forum or virtual forum display in OCF. It accepts the following parameters:
  • FILTERS: a list of applicable filters, used in virtual forums (e.g. personal topics)
  • CATEGORIES: the categories to display in this forum
  • BUTTONS: the buttons to display below the categories
  • TOPIC_WRAPPER: the topics to display in this forum

OCF_FORUM_CATEGORY

OCF_FORUM_CATEGORY wraps groups of sub-forum links into categories, to be displayed at the top of the forum listing. It accepts the following parameters:
  • CATEGORY_ID*: the ID of the category (will be HTML-escaped)
  • EXPAND_TYPE*: whether the category is expanded or contracted; the name of the image to display (will be HTML-escaped)
  • CATEGORY_TITLE*: the title of the category (will be HTML-escaped)
  • CATEGORY_DESCRIPTION*: the category description, if applicable (will be HTML-escaped)
  • DISPLAY*: the value for the CSS display property for the category (will be HTML-escaped)
  • FORUMS: the forums in the category

OCF_FORUM_IN_CATEGORY

OCF_FORUM_IN_CATEGORY is used for each forum inside a OCF_FORUM_CATEGORY template. It accepts the following parameters:
  • NEW_POST_OR_NOT*: whether there's a new post; the name of the image to display (will be HTML-escaped)
  • FORUM_URL*: the URL of the forum (will be HTML-escaped)
  • FORUM_NAME*: the forum name (will be HTML-escaped)
  • EDIT_URL*: the URL to edit the forum (will be HTML-escaped)
  • DESCRIPTION: the forum description, if applicable
  • SUBFORUMS: a list of the forum's subforums, if applicable
  • NUM_TOPICS*: the number of topics in the forum (will be HTML-escaped)
  • NUM_POSTS*: the number of posts in the forum (will be HTML-escaped)
  • LATEST: the details of the latest post in the forum

OCF_GUEST_BAR

OCF_GUEST_BAR is the guests' equivalent of OCF_MEMBER_BAR, and is displayed in the same place. It accepts the following parameters:
  • NAVIGATION: markup for zone navigation
  • LOGIN_URL*: the URL to which the login form should be submitted (will be HTML-escaped)
  • JOIN_LINK*: the URL for the join page (will be HTML-escaped)
  • FULL_LINK*: the URL for the full login page (will be HTML-escaped)

OCF_MEMBER_BAR

OCF_MEMBER_BAR is used to display the "personal bar" in OCF, if the member has it configured in wide mode (i.e. no side panels). The personal bar displays all their pertinent information and links (point count, post count, personal topics, etc.) in one bar at the top. It accepts the following parameters:
  • AVATAR*: the URL of the member's avatar, if applicable (will be HTML-escaped)
  • PROFILE_URL*: the URL of the member's profile (will be HTML-escaped)
  • USERNAME: the member's username
  • LOGOUT_URL*: the logout URL (will be HTML-escaped)
  • NUM_POINTS_ADVANCE*: the number of points the member needs to advance to the next usergroup (will be HTML-escaped)
  • NUM_POINTS*: the number of points the member has (will be HTML-escaped)
  • NUM_POSTS*: the number of posts the member has (will be HTML-escaped)
  • PRIMARY_GROUP*: the member's primary group (will be HTML-escaped)
  • LAST_VISIT_DATE*: the last date on which the member visited (will be HTML-escaped)
  • NEW_TOPICS*: a link to the new topics since the member last visited (will be HTML-escaped)
  • NEW_POSTS*: a link to the new posts since the member last visited (will be HTML-escaped)
  • PERSONAL_ZONE_URL*: the URL of the member's personal zone (will be HTML-escaped)
  • MEMBER_LINKS: a list of links for the member
  • PERSONAL_TOPIC_URL*: the URL of the member's personal topic virtual forum (will be HTML-escaped)
  • PT_EXTRA: lists personal topic activity, if applicable
  • NEW_POSTS_URL*: the URL for the new posts since the member last visited (will be HTML-escaped)
  • UNREAD_TOPICS_URL*: the URL for the member's unread topics (will be HTML-escaped)

OCF_TOPIC_POST

OCF_TOPIC_POST contains a single post in a topic in OCF, including the poster's details, and the moderation buttons along the bottom. It accepts the following parameters:
  • POST_TITLE*: the title of the post, if applicable
  • CLASS*: the CSS class to apply to the post (will be HTML-escaped)
  • EMPHASIS*: the markup to apply to the post if it's emphasised (will be HTML-escaped)
  • ID*: the post ID (will be HTML-escaped)
  • FIRST_UNREAD: the markup to apply to the post if it's the first unread post in the topic
  • POST_DATE*: the date and time at which the post was made (will be HTML-escaped)
  • UNVALIDATED*: the markup to apply to the post if it's unvalidated (will be HTML-escaped)
  • POST_URL*: an URL pointing to the post, including an anchor reference (will be HTML-escaped)
  • POSTER: the poster's name, and markup for details on hovering over their name
  • POST_AVATAR: the poster's avatar
  • POSTER_TITLE: the poster's title
  • RANK_IMAGES: the poster's rank images
  • POST: the actual post content
  • LAST_EDITED: when the post was last edited, if applicable
  • SIGNATURE: the poster's signature
  • BUTTONS: the moderation and reply buttons to display

OCF_TOPIC_WRAP

OCF_TOPIC_WRAP wraps all the posts in the topic view of a topic on OCF. It displays all the surrounding control functions, buttons, and viewer listings. It accepts the following parameters:
  • PAGE_BUTTONS: the buttons (such as "new topic" and "reply") to display at the top and bottom of the page
  • POLL: the poll markup, if applicable
  • RESULTS_BROWSER: the results browser markup (page navigation)
  • POSTS: the actual posts
  • NUM_GUESTS*: the number of guests viewing the topic (will be HTML-escaped)
  • NUM_MEMBERS*: the number of members viewing the topic (will be HTML-escaped)
  • MEMBERS_VIEWING: a list of member names viewing the topic
  • MODERATOR_ACTIONS: the markup for the moderation actions (a list of option tags to be placed inside a select)
  • ACTION_URL*: the URL to which moderator and marked post actions should be submitted (will be HTML-escaped)
  • MARKED_POST_ACTIONS: the markup for the marked post actions (a list of option tags to be placed inside a select)
  • TREE: the breadcrumb forum hierarchy navigation tree
  • QUICK_REPLY: the quick reply box

OCF_WRAPPER

OCF_WRAPPER is used to wrap all pages in OCF. It accepts the following parameters:
  • TITLE: the page title
  • HEAD: the page header (usually the personal bar, if the user has it configured in wide mode)
  • NOTIFICATIONS: any notifications to be displayed (personal topic replies, etc.)
  • CONTENT: the page content
  • FOOT: the page footer (OCF statistics)

PAGE_TITLE

PAGE_TITLE is used to display the title for a page (not in the browser title bar). It accepts the following parameters:
  • ID*: the ID for the title element (will be HTML-escaped)
  • TITLE: the title text
  • HELP_URL*: the URL for a linked help document (will be HTML-escaped)
  • HELP_TERM*: the term to use as an anchor in the help document (will be HTML-escaped)
  • SUB: a subtitle, displayed below the main title

POSTING_FORM

POSTING_FORM is used for standard submission forms with Comcode content, attachments, etc. It accepts the following parameters:
  • POST_URL*: the URL to which to send all the form contents (will be HTML-escaped)
  • DEFAULT_PARSED*: a pre-parsed version of the Comcode for the post (will be HTML-escaped)
  • HIDDEN_FIELDS: any hidden fields to put in the form
  • SPECIALISATION: fields to be prepended to the form
  • POST_COMMENT*: help on how you should post (will be HTML-escaped)
  • COMCODE: the Comcode message ("this is Comcode-enabled") and WYSIWYG toggler
  • COMCODE_EDITOR: the markup for the standard Comcode WYSIWYG editor
  • CLASS*: the CSS classes to use for the Comcode editor (will be HTML-escaped)
  • POST*: the default post content
  • EMOTICON_CHOOSER: the emoticon chooser markup
  • SPECIALISATION2: fields to be appended to the form
  • HELP*: help for the form to be displayed underneath (will be HTML-escaped)
  • ATTACHMENTS: any pre-existing attachments to be displayed on the form
  • EXTRA: any extra markup or text to attach to the bottom of the form

RESULTS_BROWSER_WRAP

RESULTS_BROWSER_WRAP wraps results browsers, which are appended to multi-page content to standardise navigation, sorting, and jumping to pages. It accepts the following parameters:
  • PER_PAGE: a form allowing the user to specify how many results should be displayed per-page
  • PART: the markup for the navigation, sorting, and page jumping functions

PART is built up as follows:
  • RESULTS_BROWSER_PREVIOUS_LINK if there are previous pages, RESULTS_BROWSER_PREVIOUS if there are not (for the "previous" link)
  • RESULTS_BROWSER_CONTINUE if there are too many pages to list
  • Combinations of RESULTS_BROWSER_PAGE_NUMBER and RESULTS_BROWSER_PAGE_NUMBER_LINK for the page links
  • RESULTS_BROWSER_CONTINUE_LAST for the "last" link if there are too many pages to list
  • RESULTS_BROWSER_NEXT_LINK if there are more pages, RESULTS_BROWSER_NEXT if there are not (for the "next" link)
  • RESULTS_BROWSER_LIST_PAGES if there are too many pages to list

RESULTS_TABLE

RESULTS_TABLE is used for presenting tabulated results with sorting, to the user. It accepts the following parameters:
  • FIELDS: the actual table rows for the entries (RESULTS_TABLE_ENTRY)
  • MESSAGE: the introduction/explanatory message to display at the top
  • FIELDS_TITLE: the header cells for the table
  • SORT: the markup for the sorting form
  • BROWSER: the markup for the browser

RESULTS_TABLE_ENTRY

RESULTS_TABLE_ENTRY is the markup surrounding a row in a results table. It accepts the following parameter:
  • VALUES: the cells in the row

RESULTS_TABLE_FIELD

RESULTS_TABLE_FIELD is the markup for a cell in the results table. It accepts the following parameter:
  • VALUE: the cell content

RESULTS_TABLE_FIELD_TITLE

RESULTS_TABLE_FIELD_TITLE is the markup for a header cell in a results table. It accepts the following parameter:
  • VALUE*: the header title (will be HTML-escaped)

RESULTS_TABLE_FIELD_TITLE_SORTABLE

RESULTS_TABLE_FIELD_TITLE_SORTABLE is the markup for a sortable header cell in a results table. It accepts the following parameters:
  • SORT_URL_ASC*: the URL which will sort the table content in ascending order (will be HTML-escaped)
  • VALUE*: the header title (will be HTML-escaped)
  • SORT_URL_DESC*: the URL which will sort the table content in descending order (will be HTML-escaped)

RESULTS_TABLE_PAGE

RESULTS_TABLE_PAGE is a wrapper for a results table, used when it's the only thing on the page. It accepts the following parameters:
  • TITLE: the page title
  • RESULTS_TABLE: the results table markup

STANDARDBOX_*

STANDARDBOX_* templates are all different variations on the standard box: the box seen all through ocPortal containing and separating various pieces of information. They all accept the following parameters:
  • WIDTH*: the width (in CSS syntax) of the box (will be HTML-escaped)
  • HEIGHT*: the height (in CSS syntax) of the box (will be HTML-escaped)
  • TITLE: the title for the box
  • META: an associative array of meta values to display
  • CONTENT: the content to display in the box
  • LINKS: an array of action links to display at the bottom of the box

TOP

TOP is the page header, excluding the structural HTML markup; the system is designed that pages can be displayed without TOP, and when this is done, they appear without the top bar. It accepts the following parameters:
  • ZONES: array of zones, containing CODE* (will be HTML-escaped) and TITLE for each zone, to display in the zone bar
  • LOGOMAP: the optional logo imagemap markup
  • LOGO_URL*: the URL to the site's logo (will be HTML-escaped)
  • HEADER_TEXT*: the text to display as the title to the logo; it's the same as the HEADER_TEXT parameter for HEADER (will be HTML-escaped)

YESNO_PAGE

YESNO_PAGE is used to display a standard "yes/no" prompt to the user. It accepts the following parameters:
  • TITLE: the page title
  • TEXT: the question or prompt
  • URL*: the URL to which the answer should be posted (will be HTML-escaped)

Primary CSS classes

The following are all in global.css:
  • .global_top is used to style the top section of the page, containing the logo and zone menu
  • .global_title surrounds the page title and the breadcrumb area
  • .global_middle is the middle section of the page, containing the actual content
  • .global_side is used for both side panels, and thus contains no positional styling
  • .global_helper_panel is used for the helper panel container, but none of the content (that's styled by other classes)
  • .global_message surrounds any notifications at the bottom, including the standardboxes in which they are contained
  • .global_notification styles the actual body of each notification
  • #dyn_bottom is the bottom bar, which is positioned using Javascript due to browser support constraints
  • .standardbox_* styles are used in the three varieties of standardbox: classic (a box), panel (for use in panels) and curved (a box with curved corners). There are many standardbox classes, mainly due to the wide variety of situations in which standardboxes have to be used (with/without title, wrapped/unwrapped, internally/externally), but most of them won't need changing
  • .lightborder is a modifier style, which can be used on all sorts of things, and basically gives them a lighter border and background colour
  • .dottedborder is also a modifier style, but is mainly used for forms, and uses a dotted border, which helps link cells together
  • .medborder is another modifier style, similar to .lightborder (the two can be used interchangeably)
  • .solidborder is the last modifier style, and separates items more finally than any of the others - it too can be used on any element
  • .do_next_section surrounds do-next areas, and is basically used to apply text styles, as more specific classes are used for the borders and content styling
  • .do_next_item styles each item in a do-next area; note that a separate style (.do_next_item_hover) is used to style the elements when they're hovered over
  • .do_next_item_spacer styles each empty (spacer) item in a do-next area; it has no hover style
  • .do_next_pretty_title styles the title area, but the images to either side are provided by .do_next_pretty_title_left and .do_next_pretty_title_right
  • .required_field_warning styles the notification above forms telling the user what a required field looks like (note that required fields themselves are usually styled using .dottedborder_barrier_a_required for the label cell and .dottedborder_barrier_b_required for the field cell itself)

Useful symbols

  • $KEEP: the GET pairs which need to be preserved in the URL (should be used with any hard-coded URL not generated by build_url or equivalent)
  • $IMG: return the URL to a theme image with the specified name (documented in more detail in the standard themeing tutorial)
  • $THEME: return the name of the current theme
  • $FIND_SCRIPT: return the URL to a script with the specified name
  • $LANG: the user's language
  • $BASE_URL: the base URL of the installation
  • $CUSTOM_BASE_URL: the custom base URL of a shared installation
  • $ANCHOR: return the markup for an anchor of the specified name
  • $RAND: return a random number between 0 and 32000
  • $SET_RAND: return a random number between 0 and the value specified
  • $SITE_NAME: the name of the site
  • $STAFF_ADDRESS: an obfuscated form of the staff e-mail address
  • $DOMAIN: the website domain
  • $ZONE: the current zone
  • $PAGE: the current page
  • $IS_GUEST: is the current user a guest?
  • $IS_STAFF: is the current user staff?
  • $IS_SUPER_ADMIN: is the current user a super administrator?
  • $HAS_ACTUAL_PAGE_ACCESS: does the current user actually have page access to the specified page?
  • $BROWSER_MATCHES: is the user's browser the specified parameter (e.g. "ie")?
  • $SET: set a Tempcode variable (parameter 1) to the specified values (all other parameters)
  • $GET: get the value of a specified Tempcode variable
  • $IS_NON_EMPTY: is the specified parameter not empty?
  • $IS_EMPTY: is the specified parameter empty?
  • $NOT: returns true if the specified parameter is false, and vice-versa
  • $AND: returns true if all the specified parameters are true; false otherwise
  • $OR: returns true if one (or more) of the specified parameters are true; false otherwise
  • $CSS_DIMENSION_REDUCE: reduces the specified dimension by the specified amount (while preserving the suffix)
  • $PAGE_LINK: returns the URL of a page, specified by the match-key parameter (e.g. "_SELF:pagename:type:1")
  • $CYCLE: cycles through a set of values (parameter 2 onwards) every time it is called with a specified cycle identifier (parameter 1) (e.g. {$CYCLE,mycycle,a,b,c,d} would produce "a" the first time it's called, "b" the next, "c" next, then "d", then back to "a" again)#
  • $FIX_ID: returns a version of the first parameter with characters illegal in an ID replaced with legal references (e.g. "*" becomes "_star_")
  • $CSS_DIMENSION_REDUCE: enables the reduction of a CSS pixel dimension (parameter 1) by the specified amount (parameter 2), transparently dealing with the "px" suffix; dimensions can also be increased by making parameter 2 negative

Useful directives

IF_EMPTY

IF_EMPTY renders the specified content if the passed parameter is completely empty. It accepts the following parameter:
  • Parameter of which to check emptyness

Code

{+START,IF_EMPTY,{A_PARAM}}
<p>Hello world!</p>
{+END}

If {A_PARAM} was empty, "Hello world!" would be outputted. Otherwise, it wouldn't.

IF_NON_EMPTY

IF_NON_EMPTY renders the specified content if the passed parameter is not empty. It accepts the following parameter:
  • Parameter of which to check emptyness

Code

{+START,IF_NON_EMPTY,{B_PARAM}}
<p>Hello world!</p>
{+END}

If {B_PARAM} was not empty, "Hello world!" would be outputted. Otherwise, it wouldn't.

BOX

BOX renders a standard box of the specified type around the content. It accepts the following parameters:
  • Title
  • Width (e.g. "100%")
  • Type (e.g. "classic")
  • Options
  • Meta
  • Links
It is documented in more detail in the standard themeing tutorial.

LOOP

LOOP loops through an array of values, outputting the content with each array key's values sequentially. It accepts the following parameters:
  • Array through which to loop
In the content, references to loop_key and loop_var can be used, to refer to the current iteration's key and value, respectively. If the array is multidimensional, parameters can be used with the names of the keys in the second-level array in the current iteration.

See also