Welcome

BoltWire is a content management system developed by Dan Vis.

Welcome Tour
Documentation
Mailing List



Popular Posts

Version 5.11 Released
May 26, 2016

Big Changes Coming Soon...
April 28, 2016

Catching Up
April 6, 2016



Other Sites

Here's some other sites by Dan Vis:

Alexa Echoes
Join my adventures developing for Amazons exciting new voice platform.

Firefly Spot
Personal rambling about new gadgets, technology news, and space travel.

FAST Missions
My ministry hub, with news and updates about our online school.

You can follow him at www.danvis.info.

Forms and Actions

Documentation > Getting Started > Forms and Actions

The secret sauce that sets BoltWire apart from any other content management system currently available is its amazing forms processing capabilities.

Rather than hardcoding site actions, BoltWire uses simple forms in your site (called action pages) to tap into a powerful, yet secure, form processor. The advantage to this approach is you can then modify these action pages any way you desire. You can also create entirely new actions, that tap into the inner workings of BoltWire with virtually no limitation.

We have worked hard to make our form generation markup as simple and intuitive as possible. And we have given the ZAP form processor the ability to respond to a wide range of powerful commands. By combining these forms and commands with other elements of BoltWire markup--you can create complex and sophisticated actions, in a snap!

To illustrate how easy it is to do something in BoltWire, we'll walk you through the process of creating a simple address book.

Step One: Gather Data

Our first step is to create an input form members can use to enter their contact information. We'll create an action page for this called action.address, and save our markup there. Let's give it the following content:


[form]
Address: [text address]
City: [text city]
State: [text state]
Zip: [text zip]
[submit SAVE]
[form]

This markup generates a simple input form with four text fields, and a save button. However, the form won't do anything when the button is clicked because we haven't yet added any commands. Commands tell BoltWire what to do with this form when submitted. So let's tell it to save the information.


[form]
Address: [text address]
City: [text city]
State: [text state]
Zip: [text zip]
[submit SAVE]
[command savedata address,city,state,zip page=member.{id}]
[command nextpage member.{id}]
[form]

The savedata command tells BoltWire to store the specified data fields on the current users member page. The nextpage command tells BoltWire where to forward the user after the form is processed.

Now suppose we want to check for any existing data values, and display them in the form if they exist, so the same form could be used to make minor corrections to existing address information:


[form]
Address: [text address '{~address}']
City: [text city '{~city}']
State: [text state '{~state}']
Zip: [text zip '{~zip}']
[submit SAVE]
[command savedata address,city,state,zip page=member.{id}]
[command nextpage member.{id}]
[form]

The second parameter in each input field is the syntax used to display the data field from the current users member page, if it exists.

Now let's polish things up. We'll put the form into a table so it is formatted nicely.


[form]
[t]
[r][c]Address: [c][text address '{~address}']
[r][c]City: [c][text city '{~city}']
[r][c]State: [c][text state '{~state}']
[r][c]Zip: [c][text zip '{~zip}']
[r][c][c][submit SAVE]
[t]
[command savedata address,city,state,zip page=member.{id}]
[command nextpage member.{id}]
[form]

Go ahead. Create the page action.address in your site and then cut and past the form above into it. It's just that easy to create a powerful new action in BoltWire!


Step Two: Retrieve Data

Of course, we're not finished yet. We need someway to access that information.

Let's do that by creating a simple list of all the users in your site--using this bit of code. For now, let's put it on page main.addresses:


Click a name to see their address:
[(search group=member fmt='[[{+p}|+]]' count=false)]

Basically, we are using the search function to generate a list of all your member pages, and display a link to each. We set count to false, to make sure we are not limited to the first 50 members only.

Now lets put a display of a person's address information on the top of each member page, using the member.header page:


{:title}
{:address}
{:city}, {:state}  {:zip}

Since we want to retrieve data variables from the page we are viewing, rather than the viewer's member page, we use a slightly different markup to get the data vars.

Now let's add a link to the address action page, but only display it if you are viewing your own member page.


{:title}
{:address}
{:city}, {:state}  {:zip}
[if equal {p} member.{id}][[{p}&action=address|UPDATE INFO]][if]

Go ahead and save this code to member.header, and give it a try. Go to page main.addresses to see your list of names, click a name to see their contact info, and if you pick your own name, you can edit your information.

There is much more we could do to make this addressbook more powerful. You could for example create an admin page to allow admins to edit any member's address information. You could use the search function to generate mailing labels--maybe limiting it to users in a given city or state. We could also check to see if address info has been saved, and if not display some message indicating no information is available. The possibilities are endless...

BoltWire comes with full support for all basic html input types and 30 powerful commands that enable you to accomplish just about anything you would want in a web form. After all, it runs everything in BoltWire!

Best of all, it is intuitive and easy to use...

NEXT