{
"asset": {
"prefix": "asset",
"body":
"{% set asset = ${1:entry.assetFieldHandle}.one() %}\n\n{% if asset %}\n\t\n{% endif %}",
"description": "asset"
},
"assets": {
"prefix": "assets",
"body":
"{% for image in craft.assets.\n\t.sourceId(\"${1:1}\")\n\t.kind(\"${2:image}\")\n\t.limit(${3:10})\n}).all() %}\n\t
\n{% endfor %}\n$0",
"description": "craft.assets"
},
"autoescape": {
"prefix": "autoescape",
"body": "{% autoescape \"${1:type}\" %}\n\t$0\n{% endautoescape %}",
"description": "autoescape"
},
"blockb": {
"prefix": "blockb",
"body": "{% block ${1:name} %}\n\t$0\n{% endblock %}",
"description": "block (block)"
},
"block": {
"prefix": "block",
"body": "{% block ${1:name} %}$0{% endblock %}",
"description": "block"
},
"blockf": {
"prefix": "blockf",
"body": "{{ block(\"${1:name}\") }}$0",
"description": "blockf"
},
"cache": {
"prefix": "cache",
"body": "{% cache %}\n\t$1\n{% endcache %}\n$0",
"description": "cache"
},
"case": {
"prefix": "case",
"body": "{% case \"${1:value}\" %}\n\t$0",
"description": "case"
},
"children": {
"prefix": "children",
"body": "{% children %}$0",
"description": "children"
},
"ceil": {
"prefix": "ceil",
"body": "ceil($1)$0",
"description": "ceil"
},
"assetso": {
"prefix": "assetso",
"body":
"{% set assets = craft.assets({\n\tsourceId: \"${1:1}\",\n\tkind: \"${2:image}\",\n\tlimit: ${3:10}\n}).all() %}\n\n{% for image in assets %}\n\t
\n{% endfor %}\n$0",
"description": "craft.assets - object syntax"
},
"categorieso": {
"prefix": "categorieso",
"body":
"{% set categories = craft.categories({\n\tgroup: \"${1:categoryGroupHandle}\",\n\tlimit: \"${2:11}\"\n}).all() %}\n\n
\n\t{{ dump($1) }}\n\n{% exit %}$0",
"description": "dump and die"
},
"do": {
"prefix": "do",
"body": "{% do $1 %}$0",
"description": "do"
},
"dojs": {
"prefix": "dojs",
"body": "{% do view.registerJsFile \"${1:url}\" %}$0",
"description": "do js"
},
"docss": {
"prefix": "docss",
"body": "{% do view.registerCssFile \"${1:url}\" %}$0",
"description": "do css"
},
"dump": {
"prefix": "dump",
"body": "\n\t{{ dump($1) }}\n",
"description": "dump"
},
"else": {
"prefix": "else",
"body": "{% else %}\n\t$0",
"description": "else"
},
"embed": {
"prefix": "embed",
"body": "{% embed \"${1:template}\" %}\n\t$0\n{% endembed %}",
"description": "embed"
},
"endautoescape": {
"prefix": "endautoescape",
"body": "{% endautoescape %}$0",
"description": "endautoescape"
},
"endblock": {
"prefix": "endblock",
"body": "{% endblock %}$0",
"description": "endblock"
},
"endcache": {
"prefix": "endcache",
"body": "{% endcache %}$0",
"description": "endcache"
},
"endembed": {
"prefix": "endembed",
"body": "{% endembed %}$0",
"description": "endembed"
},
"endfilter": {
"prefix": "endfilter",
"body": "{% endfilter %}$0",
"description": "endfilter"
},
"endfor": {
"prefix": "endfor",
"body": "{% endfor %}$0",
"description": "endfor"
},
"endif": {
"prefix": "endif",
"body": "{% endif %}$0",
"description": "endif"
},
"endifchildren": {
"prefix": "endifchildren",
"body": "{% endifchildren %}$0",
"description": "endifchildren"
},
"endcss": {
"prefix": "endcss",
"body": "{% endcss %}$0",
"description": "endcss"
},
"endjs": {
"prefix": "endjs",
"body": "{% endjs %}$0",
"description": "endjs"
},
"endmacro": {
"prefix": "endmacro",
"body": "{% endmacro %}$0",
"description": "endmacro"
},
"endnav": {
"prefix": "endnav",
"body": "{% endnav %}$0",
"description": "endnav"
},
"endset": {
"prefix": "endset",
"body": "{% endset %}$0",
"description": "endset"
},
"endspaceless": {
"prefix": "endspaceless",
"body": "{% endspaceless %}$0",
"description": "endspaceless"
},
"endswitch": {
"prefix": "endswitch",
"body": "{% endswitch %}$0",
"description": "endswitch"
},
"endtrans": {
"prefix": "endtrans",
"body": "{% endtrans %}$0",
"description": "endtrans"
},
"endverbatim": {
"prefix": "endverbatim",
"body": "{% endverbatim %}$0",
"description": "endverbatim"
},
"exit": {
"prefix": "exit",
"body": "{% exit ${1:404} %}",
"description": "exit"
},
"extends": {
"prefix": "extends",
"body": "{% extends \"${1:template}\" %}$0",
"description": "extends"
},
"filterb": {
"prefix": "filterb",
"body": "{% filter ${1:name} %}\n\t$0\n{% endfilter %}",
"description": "filter (block)"
},
"filter": {
"prefix": "filter",
"body": "{% filter ${1:name} %}$0{% endfilter %}",
"description": "filter"
},
"floor": {
"prefix": "floor",
"body": "floor($1)$0",
"description": "floor"
},
"fore": {
"prefix": "fore",
"body":
"{% for ${1:item} in ${2:items} %}\n\t$3\n{% else %}\n\t$0\n{% endfor %}",
"description": "for ... else"
},
"for": {
"prefix": "for",
"body": "{% for ${1:item} in ${2:items} %}\n\t$0\n{% endfor %}",
"description": "for"
},
"from": {
"prefix": "from",
"body": "{% from \"${1:template}\" import \"${2:macro}\" %}$0",
"description": "from"
},
"endbody": {
"prefix": "endbody",
"body": "{{ endBody() }}\n$0",
"description": "endBody"
},
"head": {
"prefix": "head",
"body": "{{ head() }}\n$0",
"description": "head"
},
"if": {
"prefix": "if",
"body": "{% if ${1:condition} %}$2{% endif %}\n$0",
"description": "if"
},
"ifb": {
"prefix": "ifb",
"body": "{% if ${1:condition} %}\n\t$0\n{% endif %}",
"description": "if (block)"
},
"ife": {
"prefix": "ife",
"body": "{% if ${1:condition} %}\n\t$2\n{% else %}\n\t$0\n{% endif %}",
"description": "if ... else"
},
"if1": {
"prefix": "if",
"body": "{% if ${1:condition} %}$0{% endif %}",
"description": "if"
},
"ifchildren": {
"prefix": "ifchildren",
"body": "{% ifchildren %}\n\t$1\n{% endifchildren %}\n$0",
"description": "ifchildren"
},
"import": {
"prefix": "import",
"body": "{% import \"${1:template}\" as ${2:name} %}$0",
"description": "import"
},
"importself": {
"prefix": "importself",
"body": "{% import _self as ${1:name} %}$0",
"description": "importself"
},
"inckv": {
"prefix": "inckv",
"body":
"{% include \"${1:template}\" with {\n\t${2:key}: ${3:\"${4:value}\"}\n} %}\n$0",
"description": "include w/ key/value"
},
"include": {
"prefix": "include",
"body": "{% include \"${1:template}\" %}$0",
"description": "include"
},
"inc": {
"prefix": "inc",
"body": "{% include \"${1:template}\" %}$0",
"description": "inc"
},
"incp": {
"prefix": "incp",
"body": "{% include \"${1:template}\"${2: with ${3:params} }%}$0",
"description": "include w/ params"
},
"css1": {
"prefix": "css",
"body": "{% do view.registerCssFile(\"${1:/resources/css/global.css}\") %}\n$0",
"description": "registerCssFile"
},
"js": {
"prefix": "js",
"body": "{% js %}\n\t$1\n{% endjs %}\n$0",
"description": "js"
},
"js1": {
"prefix": "js",
"body": "{% do view.registerJsFile(\"${1:/resources/js/global.js}\") %}\n$0",
"description": "registerJsFile"
},
"css": {
"prefix": "css",
"body": "{% css %}\n\t$1\n{% endcss %}\n$0",
"description": "css"
},
"macro": {
"prefix": "macro",
"body": "{% macro ${1:name}(${2:params}) %}\n\t$0\n{% endmacro %}",
"description": "macro"
},
"matrix": {
"prefix": "matrix",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% if block.type == \"${2:blockHandle}\" %}\n\t\t{{ block.${3:fieldHandle} }}\n\t{% endif %}\n\n\t{% if block.type == \"${4:blockHandle}\" %}\n\t\t{{ block.${5:fieldHandle} }}\n\t{% endif %}\n\n{% endfor %}\n$0",
"description": "matrix"
},
"matrixif": {
"prefix": "matrixif",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% if block.type == \"${2:blockHandle}\" %}\n\t\t{{ block.${3:fieldHandle} }}\n\t{% endif %}\n\n\t{% if block.type == \"${4:blockHandle}\" %}\n\t\t{{ block.${5:fieldHandle} }}\n\t{% endif %}\n\n{% endfor %}\n$0",
"description": "matrixif"
},
"matrixifelse": {
"prefix": "matrixifelse",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% if block.type == \"${2:blockHandle}\" %}\n\n\t\t{{ block.${3:fieldHandle} }}\n\n\t{% elseif block.type == \"${4:blockHandle}\" %}\n\n\t\t$0\n\t\n\t{% endif %}\n\n{% endfor %}",
"description": "matrixifelse"
},
"matrixswitch": {
"prefix": "matrixswitch",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% switch block.type %}\n\n\t\t{% case \"${2:blockHandle}\" %}\n\n\t\t\t{{ block.${3:fieldHandle} }}\n\n\t\t{% case \"${4:blockHandle}\" %}\n\n\t\t\t$0\n\n\t{% endswitch %}\n\n{% endfor %}",
"description": "matrixswitch"
},
"max": {
"prefix": "max",
"body": "max(${1:$2, $3})$0",
"description": "max"
},
"min": {
"prefix": "min",
"body": "min(${1:$2, $3})$0",
"description": "min"
},
"nav": {
"prefix": "nav",
"body": "{% nav ${1:item} in ${2:items} %}\n\t$3\n{% endnav %}\n$0",
"description": "nav"
},
"paginate": {
"prefix": "paginate",
"body":
"{% paginate ${1:elements} as ${2:pageInfo}, ${3:pageEntries} %}\n\n{% for item in ${3:pageEntries} %}\n\t$0\n{% endfor %}\n\n{% if ${2:pageInfo}.prevUrl %}Previous Page{% endif %}\n{% if ${2:pageInfo}.nextUrl %}Next Page{% endif %}",
"description": "paginate simple"
},
"paginate1": {
"prefix": "paginate",
"body":
"{# PAGINATION\n\t\t\nFor this pagination to work properly, we need to be sure to set\nthe paginateBase variable in the template we are including the \npagination in.\n\n{% set paginateBase = \"/blog/p\" %}\n#}\n\n{% if pageInfo.totalPages > 1 %}\n