You are viewing Revision 2 of APIs_RegShortCode

This page is registered as a special page, however you are viewing a previous revision of the page. As such, the special page function will not be triggered.

NOTE: This API was introduced in Version 0.40

Subroutine Name

RegShortCode

Explanation and Usage

This subroutine registers a short code and its associated subroutine. You will then call a short code in your page by placing the text %ShortCodeName% where you want its output to go. It's important to note that short codes do not print directly, rather, they return text (which must be HTML formatted, not Markup formatted as this will get called after Markup() is run).

Syntax

RegShortCode(Name, Subroutine)

Options

Name - This is the name to associate with the action.

Subroutine - This should be the subroutine that is called when the action you specify is called via the 'do' parameter. Must be entered in this format: \&SubroutineName

Examples

These are actual examples from the Aneuch source code:

RegShortCode('search', \&DoSearchShortCode);
In this example, which comes from the InitVars sub, we're registering the 'search' short code, which will call the sub DoSearchShortCode().