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

Inlist

The inlist conditional checks whether an item is in a comma separate list of values. It is one of several tools that give Boltwire powerful list handling capabilities.

The first parameter (or parameter 'item') determines what we are looking for in the list. It defaults to the current user.

The second parameter (or parameter 'list') can be an actual csv list, or point to a page. It is required.

Here are some examples of how it is used:

[if inlist {id} alice,bob,charlie,donna]true[if]
[if inlist item=bob list=alice,bob,charlie,donna]true[if]
Checks to see if current use is one of those four names

Note: the following will fail because BoltWire expects the list to be in parameter two, but BoltWire sees it as being in parameter one. It would make more sense to change the order of the parameters--but that would disrupt existing sites. Expect this in a future release.

[if inlist item=bob alice,bob,charlie,donna]true[if]

A case=false parameter can be added to make this check case insensitive. The first example below fails, the second passes.

[if inlist item=Bob alice,bob,charlie,donna]false[if]
[if inlist item=Bob alice,bob,charlie,donna case=false]true[if]

If you point the list to a single page that exists in your site, it will use the contents of that page as your list, converting line breaks into commas. So the following for example would be roughly equivalent:

[if inlist bob group.admin]true[if]
[if ingroup admin bob]true[if]

You could of course set the list to any page. Also, the item does not have to be a member id. You could check for any page names, or colors or number, or whatever.

Note: spaces in your list will produce unexpected results unless they are enclosed in quote marks. The first two below will work as expected. The third will fail.

[if inlist bob 'alice, bob, charlie, donna']true[if]
[if inlist bob list='alice, bob, charlie, donna']true[if]
[if inlist bob alice, bob, charlie, donna]false[if]