Bricks Help

button_brick
display_brick
email_brick
filter_brick
if_brick
include_brick
input_brick
sort_brick
tag_brick

General Rules

  • The following symbols are reserved for internal brick control and should not be used within the value of a “name=” parameter:  .^!:(){}[]
  • Since a field can appear in a form multiple times, the ‘Name” attribute is used to reference the particular field and is the value tied to the field when stored in a usercustom_field.
  • Because of the use for internal brick control, do not use names within CSS styling.  Rely on class and id.
  • Bricks that require a form must be within a brick included form. They will not work within a form defined directly.
  • HTML rules prohibit forms within forms.  Thus brick forms cannot be nested, nor can a brick form be in a regular form or a regular form in a brick form.
  • If you discover that your html editor of choice is rearranging or discarding your bricks, surround them with “<!–bricks–” and “–bricks–>”. They will be treated as comments and not rearranged in your editor, but WP Bricks will strip them so that the bricks will not be hidden as comments on your web page!


button_brick help
Display a clickable button anywhere on a page. Unless noted otherwise, it must be in a form defined by an include_brick.
(Add or update of posts is not yet implemented. Search of users is not yet implemented.)
AttributeValuesDefault
actionsActions can be one or more of the following, separated by the bar '|' symbol, such as 'add|update|login'
addAdd post or user if new.
updateUpdate existing post or user. Fail if post or user doesn't exist.
login(Users only) Login if not already logged in as this user
logout(Users only) If there is a logged in user, log them out
(Does not need to be in a form.)
save(only if a this or a parent page is included using a usercustom_field defined) Save the form values to the user custom field. All values in the form will be added to the custom field. All values not in the form will be removed.
addset(Only used when on a page or child of a page that has the action attribute of "Add"). Add the current set of field values to the form.
deleteset(Only used on a page or child of a page that has the action attribute of "list"). Delete the current set of field values from the form.
searchForm is used to search for matches to user or post fields in the form
getSubmit form as a get, not post. Because of the size limitation on a url, this is done as a post followed by a get using tokens.
no default
objects'user', 'post', or 'user|post': needed only if the action isn't restricted to users or posts.
The object to which fields are added, updated, or searched.
no default
pageThe name (slug) of the destination page when this button is clicked
if '*' is the first character in the page then use this page with the optional addition of new parameters (eg. '*?parameter=value&parameter=value')
(The added parameters are passed directly to the page programatically and do not appear on the URL in the browser.)
* (this page)
ajaxThe id of the dom object whose inner HTML will be replaced with the contents of the destination page'' (page load not using ajax)
defaultbuttonif yes, the button associated with form submission using the enter key.no
labelThe text label on the buttonno default
external'no' if this defines an actual brick button
'yes' if this is the name of an external button that will submit this form including all bricks within the form.
'no'
styleDirect CSS styling for the buttonno default
classThe CSS class of the button'c', page, and 'action' separated by underscores
eg c_destination-page_login
nameThe html name of the button'n', page, and 'action' separated by underscores
eg n_destination-page_login
idThe html id of the button'i', page, and 'action' separated by underscores
eg i_destination-page_login
help'yes' or 'no''no'

back to the top of page

display_brick help
Display the value of a Wordpress field anywhere on a page.
For users this is the logged in or selected user.
AttributeValuesDefault
valueThe value to be displayed:
post
field
<fieldname>Defines a field belonging to the WP posts table, eg. value='post.field.post_type'
meta
<fieldname>Defines a non-custom field belonging to the WP postmeta table, eg. value='post.meta._price'
custom
<fieldname>Defines a custom field belonging to the WP postmeta table, eg. value='post.custom.publisher'
user
field
<fieldname>Defines a field belonging to the WP users table, eg. value='user.field.user_email'
meta
<fieldname>Defines a non-custom field belonging to the WP usermeta table, eg. value='user.meta.last_name'
custom
<fieldname>Defines a custom field belonging to the WP usermeta table, eg. value='user.custom.allowance'
option
<fieldname>Defines a field within the WordPress option named by a parent include_brick's 'option_field' paramter.
As an example, if the display_brick references option_field='employees', then here value='option.last_name' would be the last_name field within the employees option.
$_SERVER
<name>Reference to the value of the server variable 'name'. If the variable is missing, treat as empty string ('').
search
items_per_pageDefines the field where the user can see the number of items shown per page, eg. value='search.items-per-page'
page_numberDefines the field where the user can see the page being displayed, eg. value='search.page-number'
total_items_foundDefines the field where the user can see the total number of items found, eg. value='search.total-items-found'
NOTE: some fields, such as image IDs, have additional fields, such as the type of image and what about the image is to be retrieved. An example would be value='post.meta._thumbnail_id.thumbnail.url' which would retrieve the 'thumbnail' image as a 'url' from the image ID.
no default
formatHow to display the value if not 'as is':
imageDisplay the field as the src for an image. Also, there is no span.
currencyDisplay the field as currency
M d, YSpecial date/time formatting as defined in the table here: Date/Time Formatting. This is an example. Anything that obeys the rules can be used.
no default
default_valueDisplay this if no existing input source (form, custom field, or user)no default
spanno: do not surround the value with a span specifying the id, style, class, and name.yes
styleDirect CSS styling for the displayed valueno default
classThe CSS class of the displayed field'c' and the name of the field separated by underscores
eg c_user_email
nameThe html name of the displayed field.
Also, the name of the field if loaded from a form stored in a usercustom_field.
'n' and the name of the field separated by underscores
eg n_user_email
idThe html id of the displayed field'i' and the name of the field separated by underscores
eg i_user_email
help'yes' or 'no''no'

back to the top of page

email_brick help
Send an email when the page containing this brick is displayed.
AttributeValuesDefault
toThe email address of the recipientthe email address of the current logged in or selected user.
pageThe name (slug) of the page used as the body of the email messageno default
subjectThe subject of the email messageno default
fromThe from address formatted as 'name <emailaddress>'no default
help'yes' or 'no''no'

back to the top of page

filter_brick help
Define how an input field in the current form is used in a search.
(Multiple non-exclusive filters can be applied to the same field.)
AttributeValuesDefault
filter
all_anyFor brick meta fields searched with checkboxes, must the found item match all the checked items or any of them.
Default_value can be set to 'all' or 'any' ('any' assumed if the default value not specified)
equal|greatermatch if the value found is equal to or greater than the value in the field.
equal|lessmatch if the value found is equal to or less than the value in the field.
greatermatch if the value found is stricktly greater than the value in the field.
lessmatch if the value found is stricktly less than the value in the field.
listmultiple values can be placed in the field and a match will happen if any of the items are found.
partial_matchFor text fields, must the field exactly match or is a match within the field accepted.
Default_value can be set to 'checked' or 'unchecked' ('unchecked' assumed if the default value not specified)
type'text' if the field is tested as text. 'number' if the field is to be tested as a number.
This can be used with any other filter except 'partial_match', which is always text and ignores this filter.
Default_value can be set to 'text' or 'number' ('text' assumed if the default value not specified)
no default
field_nameThe html name of the field for which the filter is defined.no default
default_valueRefer to the filters for the possible values and the default if no value specified.see filters above.
delimiterThe delimiter used to separate values if this is a 'list' filtercomma
hidden'yes' if the filter is hidden and uses the specified default value.
'no' if the user can change the filter setting.
'no'
classThe css class of the filter'fc' and the field name separated by underscores
eg fc_n_user_email
idThe html id of the filter'fi' and the field name separated by underscores
eg fi_n_user_email
help'yes' or 'no''no'

back to the top of page

if_brick help
Show everything after this brick only if the condition of the 'if' is met.
If_bricks can be nested and all bricks, including include bricks are processed or not processed between a matching if_brick and endif_brick based on the truth of the condition.
AttributeValuesDefault
logicDoes this if_brick 'or' with the previous 'if' brick or do an 'and'.
andThe test must be true for all following content to be displayed and used.
orThe test of the previous if_brick OR this if_brick must be true. Can only be used if the immediate preceeding brick is an if_brick. If the preceeding if_brick was 'and' AND it changed the display of content from true to false, then if the result is true for this or any immediately following if 'or' bricks, then the display is enabled.
An if 'or' brick does not use an 'endif' brick to terminate the logic.

Example:
    [if_brick ...][if_brick ...][if_brick logic='or' ...][if_brick logic='or' ...] content [endif_brick][endif_brick]
        If the first if_brick is false, the content does not show. the tests in the next three if_bricks are not made.
        Otherwise, if all three of the following if_bricks fail, the content does not show. if any of the three is true, then the content does show.
'and'
valueThe value to be tested:
post
field
<fieldname>Defines a field belonging to the WP posts table, eg. value='post.field.post_type'
meta
<fieldname>Defines a non-custom field belonging to the WP postmeta table, eg. value='post.meta._price'
custom
<fieldname>Defines a custom field belonging to the WP postmeta table, eg. value='post.custom.publisher'
user
field
<fieldname>Defines a field belonging to the WP users table, eg. value='user.field.user_email'
meta
<fieldname>Defines a non-custom field belonging to the WP usermeta table, eg. value='user.meta.last_name'
custom
<fieldname>Defines a custom field belonging to the WP usermeta table, eg. value='user.custom.allowance'
id
<fieldId>Reference to a field on the current web page. The truth of this if_brick is rechecked each time the value of the specified field changes.
(if_bricks using 'id' values must be the last bricks in a set of 'or' bricks.)
$GLOBALS
<name>Reference to the value of global variable 'name'. If the variable is missing, treat as empty string ('').
$_GET
<name>Reference to the value of the http get variable 'name'. If the variable is missing, treat as empty string ('').
$_POST
<name>Reference to the value of the http post variable 'name'. If the variable is missing, treat as empty string ('').
$_SERVER
<name>Reference to the value of the server variable 'name'. If the variable is missing, treat as empty string ('').
action
post.addA post is being added, eg value='action.post.add'. Valid compare values are 'yes' and 'no'.
post.updateA post is being updated, eg value='action.post.update'. Valid compare values are 'yes' and 'no'.
searchA search has been requested, eg value='action.search'. Valid compare values are 'yes' and 'no'.
user.addA user is being added, eg value='action.user.add'. Valid compare values are 'yes' and 'no'.
user.loginA user is being logged in, eg value='action.user.login' Valid compare values are 'yes' and 'no'.
user.updateA user is being updated, eg value='action.user.update'. Valid compare values are 'yes' and 'no'.
list
<listname>
countthe number of items in the list, eg to get the numbe of entries in the 'titles' list, use value='list.titles.count'.
no default
is
equalif the field or the result of the action is equal to the value or error
greaterthanif the field or the result of the action is greater than the value or error
greaterthan|equalif the field or the result of the action greater than or is equal to the value or error
lessthanif the field or the result of the action is less than the value or error
lessthan|equalif the field or the result of the action is less than or equal to the value or error
unequalif the field or the result of the action is not equal to the value or error
no default
compare_valueThe value the field is being compared to.
Either compare_value or error must be present, but not both.
no default
error
existing_user_loginAn attempt was made to add a user that already existed.
invalid_emailAn attempt was made to login a user with an invalid or non=matching email address.
(more)Other errors will be added as they are needed.
no default
help'yes' or 'no''no'
endif_brick help
Specifies the end of the information content controlled by the previous matching if_brick.
AttributeValuesDefault
--There are no attributes for the endif_brick--

back to the top of page

include_brick help
Include another page at this location in the current page.
AttributeValuesDefault
pageThe name (slug) of the destination page to be included at this location in the current pageno default
post
inheritThe post defined for the included page is the current defined post.
newno post: used primarily for adding a new post or for search forms. All post fields are empty.
inherit
typeIf this is a new post, the type of new post, such as 'page', 'post', or 'product'.no default
user
inheritThe user defined for the included page is the current defined user.
loggedinThe currently logged in user
newno user: used primarily for adding a new user or for search forms. All user fields are empty.
inherit
usercustom_fieldThe name of a user custom field in the inherited user. (The field is from the inherited user even if the user attribute is not 'inherit'.) If the field is present, then the field contains a collection of post and/or user field values previously saved in a form. Note: this applies to all included pages to whatever depth within this page.no default
option_fieldThe name of a WordPress option. If the field is present, then the field contains a collection of post and/or user field values previously saved in a form. Note: this applies to all included pages to whatever depth within this page.no default
action
includeInclude this page at this location. This is the way to use the content of one page on many other pages.
formThe page defines the fields of a form. Must be used to include a page that uses or includes pages that use input or button bricks that require a form.
add(Only if within a brick form that is saved in a usercustom_field or option_field) The page contains a set of fields which can be added to a form whose fields are saved within a usercustom_field or option_field.
list(If within pages whose field values are obtained from a usercustom_field or option_field) This page is repeated for as many times as a set of fields has been added to the form using the "add" action.
(If within pages that are part of a report) This page is repeated for as many times as there are items found in the report.
reportThe page defines a report that will be generated by a submitted form to this page. If a usercustom_field or option_field is specified, then it is used and the form (if present) filters the report within the filter defined by the custom field.
'include'
spanno: do not surround the value with a span specifying the id, style, class, and name.yes
styleDirect CSS styling for the displayed valueno default
classThe CSS class of the form or div surrounding the displayed pagethe value of the page attribute
nameThe html name of the form or div surrounding the displayed pageno default if the action is 'add' or 'list'. The include brick for an 'add' action must have the same name as the name for the corresponding include with the 'list' action. For other actions, the default is the value of the page attribute.
idThe html id of the form or div surrounding the displayed pagethe value of the page attribute
help'yes' or 'no''no'

back to the top of page

input_brick help
Display an input control for the value of a Wordpress field anywhere on a page.
It must be in a form defined by an include_brick.
AttributeValuesDefault
valueThe value to be changed via user input:
post
field
<fieldname>Defines a field belonging to the WP posts table, eg. value='post.field.post_type'
meta
<fieldname>Defines a non-custom field belonging to the WP postmeta table, eg. value='post.meta._price'
custom
<fieldname>Defines a custom field belonging to the WP postmeta table, eg. value='post.custom.publisher'
taxonomy
<taxonomy>Specifies a taxonomy for the post, eg. value='post.taxonomy.product_tag'
(Currently usable only in a search filter.)
user
field
<fieldname>Defines a field belonging to the WP users table, eg. value='user.field.user_email'
meta
<fieldname>Defines a non-custom field belonging to the WP usermeta table, eg. value='user.meta.last_name'
custom
<fieldname>Defines a custom field belonging to the WP usermeta table, eg. value='user.custom.allowance'
option
<fieldname>Defines a field within the WordPress option named by a parent include_brick's 'option_field' paramter.
As an example, if the include_brick references option_field='employees', then here value='option.last_name' would be the last_name field within the employees option.
search
items_per_pageDefines the field where the user can change the items shown per page, eg. value='search.items-per-page'
page_numberDefines the field that lets the user change the page being displayed, eg. value='search.page-number'
no default
default_valueThe default value to show if this is a new entry or the field is missing from the meta or custom field is missing from an existing entry.
If the field is a meta field of type='checkbox', the checkbox is default checked if the default value matches the label, and unchecked if otherwise.
If the default value is 'url.name', the default value is the value of the url parameter 'name'.
empty
set_valueif this parameter is present, then the value of the field is forced to this value.
This includes the use of set_value='' to set the value to empty. Do not specify this parameter to use the existing (or default) value of the field.
none
hidden'no' if the user can interact with the field.
'yes' if the field is hidden
'no'
required'no' if a value in the field is not required
'yes' if a value must be entered.
'add' if required when being added to a list.
'no'
typeDefine or override field type.
meta fields
text(default) The value assigned to the field is entered as text in a common text input field
checkboxThe field is a checkbox and if checked, the label is assigned as the value of the field
checkboxesThe Bricks meta field has multiple values, each stored as meta_key _ with a meta_value of 1 if checked.
checkboxesallSame as checkboxes, but there is a convenient check/uncheck all checkbox as the first checkbox.
dateDate selected via a calendar widget
selectThe Bricks meta field has multiple values each stored as meta_key _. The selected option will have the meta_value of 1 and all others will be missing or 0.
textareaThe value assigned to the field is entered as text in a textarea field.
custom select fields
select(default) show field as select options.
checkboxesTo search this field, show options as checkboxes.
checkboxesallSame as checkboxes, but there is a convenient check/uncheck all checkbox as the first checkbox.
otherwiseThe value in this field is ignored.
refer to values description
validationIf present and this is a text entry field, restrict content to specified content values. Ignored for textarea, checkbox, radio, or drop down fields.
integerValue must be a whole number, positive or negative
positive-integerValue must be a positive integer (1 or greater)
nonnegative-integerValue must be an integer that is 0 or greater
numberValue must be a number with 0 or more decimal places
positive-numberValue must be a positive number with zero or more decimal places
nonnegative-numberValue must be a number that is zero or greater with zero or more decimal places
no default-- no input validation
format(coming soon) how the existing value is displayed.no default
uniqueyes: If this is a text field in a list, each entry in the list mut have a unique value in this field. Ignored otherwise.no
slugyes: text value is sanitized for use as a Wordpress slug. Ignored otherwise.no
labelUsed only for meta checkbox fields: the display value of the field and the value assigned if checked.'no'
user_login'yes' if this field is used to assign a value to the user_login field or used also as the user_login field.'no'
user_pass'yes' if this field is used to assign a value to the user_pass field or used also as the user_pass field.'no'
user_nicename'yes' if this field is used to assign a value to the user_nicename field or used also as the user_nicename field.
user_display_name'yes' if this field is used to assign a value to the user display_name field or used also as the user display_name field.'no'
placeholderFor text entry fields, the prompt content to be placed in the field if empty
examples: 'mm/dd/yyyy', 'nnn-nnn-nnnn', or 'Doe, John'
For select fields, the value to be shown in the dropdown box if no option selected.
no default
styleDirect CSS styling for the input fieldno default
classThe CSS class of the displayed field'c' and the name of the field separated by underscores
eg c_user_email
nameThe html name of the displayed field
Also, the name of the field if the form is stored in a usercustom_field.
'n' and the name of the field separated by underscores
eg n_user_email
idThe html id of the displayed field'i' and the name of the field separated by underscores
eg i_user_email
help'yes' or 'no''no'

back to the top of page

sort_brick help
Sort the items in a list brick. Multiple fields can be listed in a single sort brick or multiple sort bricks can be used.
The order of the sort bricks and the fields listed within the sort bricks determines the order of the sort.
All sort bricks for a list must appear before the list brick.
AttributeValuesDefault
fieldsThe list of fields to use for the sort. If more than one, separate by commas.
Each field is composed of two parts separated by a period: 'field.sort' and each of these has multple parts also separated by periods.
An example would be: fields='user.custom.age.number.down,user.meta.last_name.text.up,user.meta.first_name.text.up':
field
post
field
<fieldname>Defines a field belonging to the WP posts table, eg. value='post.field.post_type'
meta
<fieldname>Defines a non-custom field belonging to the WP postmeta table, eg. value='post.meta._price'
custom
<fieldname>Defines a custom field belonging to the WP postmeta table, eg. value='post.custom.publisher'
user
field
<fieldname>Defines a field belonging to the WP users table, eg. value='user.field.user_email'
meta
<fieldname>Defines a non-custom field belonging to the WP usermeta table, eg. value='user.meta.last_name'
custom
<fieldname>Defines a custom field belonging to the WP usermeta table, eg. value='user.custom.allowance'
option
<fieldname>Defines a field within the WordPress option named by a parent include_brick's 'custom_field' paramter.
As an example, if the include_brick references option_field='employees', then here fields='option.last_name.text.up' would be the last_name field within the employees option.
sort
number
upsort as numbers going up from smallest to largest
downsort as numbers going down from largest to smallest
text
upsort as text going up from lowest to highest
downsort as text going down from highest to lowest
no default
listThe name of the list to be sortedno default

back to the top of page

tag_brick help
Add any html tag to a page.
AttributeValuesDefault
tagThe HTML tag, such as 'table' or '/table'no default
*any attributes which are valid for the specified tagno default
help'yes' or 'no''no'

back to the top of page