Join Now

Click here to join our
growing community:

JOIN LOGIN



Docs

Welcome Tour
Handbook
      Markups
      Variables
      Conditions
      Functions
      Forms
      Commands
      Concepts
Extensions
Pro Modules
Developers



Copyright © 2020
Terms of Use
Privacy Policy
BoltWire

Handbook

Create

The create command allows you to create a new page.

BoltWire looks for content for the new page in the following places, in this order: 1) the content parameter, 2) the value parameter, and lastly 3) the first parameter. If you set template=some.page, the content of that page will be used as the content of the new page.

The content is saved to whatever is specified in the page parameter. If not given, it saves to the current page. This is only useful in action pages as create cannot overwrite an existing page. But an action page can be called over a page that does not yet exist.

The command will fail if the user does not have write permissions.

The command will fail if the page you are writing to already exists. Use the edit action instead.

The content of the new page can by modified by several advanced parameters. These are not often needed.

1) Field Replacements. Set replace=true if you want to be able to insert values from form inputs fields and commands into the form. For example, you could do this:

[form]
Name: [text name] [submit]
[command content='My name is {=name}.' replace=true]
[form]

This would create a page with whatever name the user supplies inserted into the content of the page. Actually, this parameter is only needed when working with templates--as field replacements are done automatically on form parameters. But, if you are using a template to create the new page, the content is not in the form, and this paramter must be turned on to get field values into the template.

2) Variable Replacements. Set vars=true to be able to insert normal variables into the new page content. This works for system, data, and info vars, and looks like this:

[form]
Name: [text name] [submit]
[command content='My name is {=name}. My IP address is {+ip}.' replace=true vars=true]
[form]

Actually, you could just use the normal system variable {ip} in the example above, but again, it would not work in a template. Rather, the page content would contain the actual variable {ip} and reflect back each viewers own IP address. If I want to put the users actual IP address into a page I am creating from a template, I must use this approach.

3) Line Replacements. Set lines=false if you wish to turn this feature off. Basically BoltWire by default converts
to linebreaks when it finds it in the content of a page you are creating. Because this is the default behavior, I don't have to do anything to insert the line break I intend in the example below:

[form]
Name: [text name] [submit]
[command content='My name is {=name}.
My IP address is {+ip}.' replace=true vars=true]
[form]

I can't put linebreaks in the command because it would break the markup. I can put them in a text area ([box]) or in a template and they will work as expected. Setting lines=false will not convert line breaks to \n, it would just cause the create example above to retain the \n in the content of the new page.