aw2.if
Conditions
—————————–
Conditions can be applied to shortcode where
If any of the conditions result in false the Shortcode will not get executed
ignore=true
This will ignore the shortcode
odd=
True if Integer is odd else false
even=
True if Integer is even else false
true=
For integer if =1
For boolean if=true
For array true if has at least 1 element
For string if not ” and not null
false=
For integer if = 0
For boolean if=false
For array true if empty or does not exist
For string if null or ”
empty=
For string if=” or null or does not exist
For array true if empty or does not exist
not_empty=
For string if exists and not equal to ”
For array true if has at least 1 element
user_can=
if the user has the right
user_cannot=
if the user does not have the right
logged_in=true
true if somebody is logged in else false
not_logged_in=true
true if nobody is logged in else false
role=
true if somebody is logged and role is role id
not_role=
true if nobody is logged in or role is not role id
request_exists=
If the element exists
request_not_exists=
If the element does not exists
request_part=
True if there is a query string called part with the value as
True if there is no query string called part and the
list=
If the term exists in the list
list=
If the term does not exist in the list
cond=
cond=equal
cond=
cond!=neq
cond=
If cond >gt
cond=
If cond >=ge
cond=
If cond
If cond
Only once with this id will be generated
device=’mobile,tablet,desktop’
Only if the Device Matches. Comma separated for multiple
ajax=true
not_ajax=true
if Condition: [aw2.if not_empty='{request.x}'] [aw2.get request.x] [/aw2.if] if else condition: [aw2.if not_empty='{request.x}'] [aw2.get request.x] [/aw2.if] [aw2.else] x is empty [/aw2.else] if and condition: [aw2.if cond="{session.provider_user_id}" not_equal=""][/aw2.if] [aw2.and cond="{session.social_login}" equal="yes"] [aw2.set module.return] <script type=spa/axn axn='core.redirect' url='[aw2.get module.next_step /]'></script> [/aw2.set] [aw2.return module.return/] [/aw2.and] if or condition: [aw2.if cond="{session.provider_user_id}" not_equal=""][/aw2.if] [aw2.or cond="{session.social_login}" equal="yes"] [aw2.set module.return] <script type=spa/axn axn='core.redirect' url='[aw2.get module.next_step /]'></script> [/aw2.set] [aw2.return module.return/] [/aw2.or]
in array substitute: [aw2.if list="comma seperated list" contains="string to search"][/aw2.if] [aw2.if list="a,b,c" contains="b"] 'b' Found [/aw2.if]
Other shortcodes
Conditionals (7)
Core (11)
- aw2.run
- aw2.return
- aw2.template
- aw2.module
- aw2.raw
- aw2.get
- aw2.set_array
- aw2.set
- aw2.echo
- aw2.shortcode
- aw2.part
CRM (1)
Database (1)
Design & JavaScript (3)
- aw2.enqueue
- aw2.client
- aw2.spa
E-commerce (1)
Excelsheet (1)
- excel.write_bulk
Form Handling (3)
- aw2.sideload
- aw2.save_form
- aw2.upload
Mailing & SMS (3)
- aw2.subscribe
- aw2.sms
- aw2.wp_mail
PDF (1)
Utility (6)
- aw2.register
- aw2.register_handler
- aw2.reset_password
- aw2.login_handler
- app.restore
- app.backup
Latest Blogs
And there’s one thing I keep noticing: Everyone's obsessed with growth hacks.