Actions
Documentation > Concepts > Actions
The secret behind BoltWire's small size, yet dramatic flexibility and power, is its action pages?. Essentially, all site actions are built within the wiki iteself -- making it easy to add, modify, or disable actions at will. And it all runs off one simple BoltWire code base.
Understanding Actions
Suppose you wanted to create a new site action, say a "greeting" action, that simply gnerated a blank page with a brief message on it. All you have to do, is create a new page named action.greeting. The page content can be simple text, a function, a complex form, or anything else you can put in a page. In our example, we might want to put content like the following on the page:
<code>
//Hello {member}!//
</code>
This will create an italicized hello followed by their member name. Go ahead and create the page now if you like...
To call your new action, you simply add &action=greeting to the end of a link or in your browser address bar, directly (you can also go to the action.greeting page). For example, suppose you put this link in a page:
<code>
[[some.page&action=greeting|Get Greeting]]
</code>
When you click the link, the action is "imposed" over the specified page (some.page). What does "imposed" mean? Simply that the some.page is still considered the current page for all page variables, data variables, etc. Only the content of the specified action page is displayed instead. Or to put it more simply they will see:
Hello
To take this one step further, suppose you modified your greeting action page to include the following line:
<code>
//Hello {member}!//
You are currently on page {p}
</code>
If you were to call that action from this page, you would see the greeting action, but {p} would be replaced by docs.tutorials.actions, rather than action.greeting. That is, this page would remain the base page, but the greeting action would be imposed over it.
Of course, you can create many more interesting kinds of actions using BoltWire's many commands and functions. You can create even more interesting effects by using conditionals on action pages -- to control what happens on a page based on many kinds of factors. To get an idea of some of the things you can do, explore the various actions currently installed in your wiki. BoltWire comes with nearly 30.
In fact, everything your wiki does is controlled by one action or another. It also means you can modify how BoltWire does anything, anyway you want. To delete an action, just delete the page. To rename an action, rename the page (to another action page). To change the wording of an action, edit the page. Everything is at your finger tips. Basically, you build your entire wiki -- right within the wiki.
Note: if you call an action that does not exist, BoltWire ignores the request, and the base page is shown.
Hierarchical Actions
BoltWire can also override actions, for local groups of pages, hierarchically. Suppose you wanted to have a different greeting occur if a visitor were on a page in one specific group of pages -- say a members page. Just create an action called action.members.greeting. Then when a person clicks members.test&action=greeting, BoltWire will load the local "members" greeting rather than the default greeting.
This is especially useful with certain actions that occur automatically. Specifically, action.missing, which pops up when a requested page does not exist, and action.blocked, which is shown when a person does not have proper permission for a requested page or action. This makes it possible for you to customize how missing or blocked pages work for any section of your site. Or even for specific pages. Simply create a page called action.members.missing, or even action.members.test.missing.
But remember, all actions are hierarchical, not just these two system actions. For more information about how to control who can use which actions, please read the tutorials on member management and security.
Learning More
Again, to learn more about some of the things you can do with "action" pages, study the various examples. Go to page "action" for a list of all the actions currently installed on your system. In creating a custom action page, consider using one of the default actions as a model, copying the markup to a new action page first and then customizing it as desired.
Also, remember that forms do not need to be in action pages. They can be put on any wiki page (by authorized editors). Action pages just make some very nice effects possible. And they are the secret behind BoltWire! For more information about forms, read the forms tutorial.

