SupportArea

BoltWire is a FREE content management system written in PHP.

Its innovative architecture combined with best-in-class forms processing makes it ideal for creating complex, interactive, web applications fast...


Documentation

Markups
Variables
Conditions
Functions
Forms
Commands
Cheatsheet

Documentation

Handbook > Conditions > Exists

This function checks to see if a page exists:

[if exists some.page]true[else]false[if]
Checks to see if some.page exists

You can use page shortcuts in this function:

[if exists ~bob]true[else]false[if]
Checks to see if member.bob exists

You can scan other directories within the local field by setting the dir parameter

[if exists img.gif dir=files]true[else]false[if]

You can check to see if a plugin exists in the plugin directory by setting dir=plugins

[if exists myplugin.php dir=plugins]true[else]false[if]

Except for the special case of the plugin directory, you cannot check for the existence of a file outside of the local field.

You can specify if you want to restrict the check to system and/or local pages. If the dir parameter is not specified, BoltWire checks both locations, and returns true if the page exists in either. Consider the following examples:

[if exists some.page]true[else]false[if]
Returns true if in the system folder or the local pages folder

[if exists some.page dir=system]true[else]false[if]
Returns true only if in the system folder, regardless of the local pages folder

[if exists some.page dir=pages]true[else]false[if]
Returns true only if in the local pages folder, regardless of the system folder

System pages are important pages included with your BoltWire installation that enable your website to function. When they are edited, a modified version is stored in your local pages folder, but the original is preserved in the system folder. The following script for example, would list all the pages in the system folder, and put a + symbole before those which have customized versions in the pages folder:

[(search group=* dir=system template='[if exists {+p} dir=pages]+[else]-[if] {+p}')]

Note: This function does NOT check view permissions to determine if a page exists.