{{ item.title }}
\n\t\t\n\t\t{{ item.date }}
\n\n\t\t{{ item.summary }}\n\t├── .vscodeignore ├── .gitignore ├── images ├── icon.png ├── icon.sketch ├── icon@2x.png └── icon.svg ├── etc └── twig-for-craft-2.html ├── package.json ├── README.md └── snippets └── snippets.json /.vscodeignore: -------------------------------------------------------------------------------- 1 | /etc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .tmp 2 | .temp 3 | .vscode 4 | .DS_Store -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selvinortiz/vs-code-twig-for-craft-2/HEAD/images/icon.png -------------------------------------------------------------------------------- /images/icon.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selvinortiz/vs-code-twig-for-craft-2/HEAD/images/icon.sketch -------------------------------------------------------------------------------- /images/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selvinortiz/vs-code-twig-for-craft-2/HEAD/images/icon@2x.png -------------------------------------------------------------------------------- /etc/twig-for-craft-2.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 |{{ dump() }}{% exit %}
116 | dump {{ dump() }}
117 | ```
118 |
119 | ### Example Forms
120 | ```
121 | formlogin Example login form
122 | formuserprofile Example user profile form
123 | formuserregistration Example user registration form
124 | formforgotpassword Example forgot password form
125 | formsetpassword Example set password form
126 | formsearch Example search form
127 | formsearchresults Example search form results
128 | ```
129 |
130 | ### Reference Hints
131 | ```
132 | info All craft.assets properties and template tags
133 | info All craft.crategories properties and template tags
134 | info All craft.config properties and template tags
135 | info All craft.entries properties and template tags
136 | info All craft.feeds properties and template tags
137 | info All craft.fields properties and template tags
138 | info All craft.globals properties and template tags
139 | info All craft.request properties and template tags
140 | info All craft.sections properties and template tags
141 | info All craft.session properties and template tags
142 | info All craft.tags properties and template tags
143 | info All craft.users properties and template tags
144 | info All craft globals (site info, date, users, template tags)
145 | ```
146 |
147 | ## Credits
148 | This extension is _heavily_ influenced by the amazing work of [Ben Parizek] on [Craft Twig for Sublime/Textmate][craft-twig]
149 |
150 | Thank you, Ben👍
151 |
152 | ## Changelog
153 |
154 | ### 0.5.0
155 | - Added `random`, `replace`, `replacex`, and `split`
156 | - Added a bunch of useful _example form_ based on the Craft docs
157 |
158 | Big thanks to [Dominic](https://github.com/DominicVonk) 👍
159 |
160 | ### 0.4.0
161 | - Fixed wrong path used in `includejs`
162 | - Renamed `ciel` to `ceil` where necessary
163 |
164 | Thank you, [Dominic](https://github.com/DominicVonk) 👍
165 |
166 | ### 0.3.0
167 | - Added full tab trigger reference table
168 | - Added `t` tab trigger for static translations
169 | - Added `dd` tab trigger for the twig context
170 | - Updated _snippets file_ to use spaces instead of tabs
171 | - Removed `dd` tab trigger for _non-template_ contexts
172 |
173 | ### 0.2.0
174 | - Added branding resources
175 | - Added extension and repository metadata
176 | - Fixed issue where snippets were not triggering suggestions
177 |
178 | ### 0.1.0
179 | - Initial (alpha) release
180 |
181 | [Ben Parizek]:https://github.com/BenParizek
182 | [craft-twig]:https://github.com/barrelstrength/Craft-Twig.tmbundle
183 |
--------------------------------------------------------------------------------
/snippets/snippets.json:
--------------------------------------------------------------------------------
1 | {
2 | "asset": {
3 | "prefix": "asset",
4 | "body": "{% set asset = ${1:entry.assetFieldHandle}.first() %}\n\n{% if asset %}\n\t{{ entries|length }} results:
\n\n\tYour search for “{{ query }}” didn’t return any results.
\n{% endif %}", 102 | "description": "craft.entries - example search results", 103 | "scope": "text.html.twig" 104 | }, 105 | "rss": { 106 | "prefix": "rss", 107 | "body": "\n{{ item.date }}
\n\n\t\t{{ item.summary }}\n\t\n\t{{ dump($1) }}\n\n{% exit %}$0",
230 | "description": "dump and die",
231 | "scope": "text.html.twig"
232 | },
233 | "do": {
234 | "prefix": "do",
235 | "body": "{% do $1 %}$0",
236 | "description": "do",
237 | "scope": "text.html.twig"
238 | },
239 | "dump": {
240 | "prefix": "dump",
241 | "body": "\n\t{{ dump($1) }}\n",
242 | "description": "dump",
243 | "scope": "text.html.twig"
244 | },
245 | "else": {
246 | "prefix": "else",
247 | "body": "{% else %}\n\t$0",
248 | "description": "else",
249 | "scope": "text.html.twig"
250 | },
251 | "embed": {
252 | "prefix": "embed",
253 | "body": "{% embed \"${1:template}\" %}\n\t$0\n{% endembed %}",
254 | "description": "embed",
255 | "scope": "text.html.twig"
256 | },
257 | "endautoescape": {
258 | "prefix": "endautoescape",
259 | "body": "endautoescape",
260 | "description": "endautoescape",
261 | "scope": "text.html.twig"
262 | },
263 | "endblock": {
264 | "prefix": "endblock",
265 | "body": "{% endblock %}$0",
266 | "description": "endblock",
267 | "scope": "text.html.twig"
268 | },
269 | "endcache": {
270 | "prefix": "endcache",
271 | "body": "{% endcache %}$0",
272 | "description": "endcache",
273 | "scope": "text.html.twig"
274 | },
275 | "endembed": {
276 | "prefix": "endembed",
277 | "body": "{% endembed %}$0",
278 | "description": "endembed",
279 | "scope": "text.html.twig"
280 | },
281 | "endfilter": {
282 | "prefix": "endfilter",
283 | "body": "{% endfilter %}$0",
284 | "description": "endfilter",
285 | "scope": "text.html.twig"
286 | },
287 | "endfor": {
288 | "prefix": "endfor",
289 | "body": "{% endfor %}$0",
290 | "description": "endfor",
291 | "scope": "text.html.twig"
292 | },
293 | "endfor1": {
294 | "prefix": "endfor",
295 | "body": "{% endfor %}$0",
296 | "description": "text.html.twig"
297 | },
298 | "endif": {
299 | "prefix": "endif",
300 | "body": "{% endif %}$0",
301 | "description": "endif",
302 | "scope": "text.html.twig"
303 | },
304 | "endif1": {
305 | "prefix": "endif",
306 | "body": "{% endif %}$0",
307 | "description": "else",
308 | "scope": "text.html.twig"
309 | },
310 | "endifchildren": {
311 | "prefix": "endifchildren",
312 | "body": "{% endifchildren %}$0",
313 | "description": "endifchildren",
314 | "scope": "text.html.twig"
315 | },
316 | "endincludecss": {
317 | "prefix": "endincludecss",
318 | "body": "{% endincludecss %}$0",
319 | "description": "endincludecss",
320 | "scope": "text.html.twig"
321 | },
322 | "endincludehirescss": {
323 | "prefix": "endincludehirescss",
324 | "body": "{% endincludehirescss %}$0",
325 | "description": "endincludehirescss",
326 | "scope": "text.html.twig"
327 | },
328 | "endincludejs": {
329 | "prefix": "endincludejs",
330 | "body": "{% endincludejs %}$0",
331 | "description": "endincludejs",
332 | "scope": "text.html.twig"
333 | },
334 | "endmacro": {
335 | "prefix": "endmacro",
336 | "body": "{% endmacro %}$0",
337 | "description": "endmacro",
338 | "scope": "text.html.twig"
339 | },
340 | "endnav": {
341 | "prefix": "endnav",
342 | "body": "{% endnav %}$0",
343 | "description": "endnav",
344 | "scope": "text.html.twig"
345 | },
346 | "endset": {
347 | "prefix": "endset",
348 | "body": "{% endset %}$0",
349 | "description": "endset",
350 | "scope": "text.html.twig"
351 | },
352 | "endspaceless": {
353 | "prefix": "endspaceless",
354 | "body": "{% endspaceless %}$0",
355 | "description": "endspaceless",
356 | "scope": "text.html.twig"
357 | },
358 | "endswitch": {
359 | "prefix": "endswitch",
360 | "body": "{% endswitch %}$0",
361 | "description": "endswitch",
362 | "scope": "text.html.twig"
363 | },
364 | "endverbatim": {
365 | "prefix": "endverbatim",
366 | "body": "{% endverbatim %}$0",
367 | "description": "endverbatim",
368 | "scope": "text.html.twig"
369 | },
370 | "exit": {
371 | "prefix": "exit",
372 | "body": "{% exit ${1:404} %}",
373 | "description": "exit",
374 | "scope": "text.html.twig"
375 | },
376 | "extends": {
377 | "prefix": "extends",
378 | "body": "{% extends '${1:template}' %}$0",
379 | "description": "extends",
380 | "scope": "text.html.twig"
381 | },
382 | "filterb": {
383 | "prefix": "filterb",
384 | "body": "{% filter ${1:name} %}\n\t$0\n{% endfilter %}",
385 | "description": "filter (block)",
386 | "scope": "text.html.twig"
387 | },
388 | "filter": {
389 | "prefix": "filter",
390 | "body": "{% filter ${1:name} %}$0{% endfilter %}",
391 | "description": "filter",
392 | "scope": "text.html.twig"
393 | },
394 | "floor": {
395 | "prefix": "floor",
396 | "body": "floor($1)$0",
397 | "description": "floor",
398 | "scope": "text.html.twig"
399 | },
400 | "fore": {
401 | "prefix": "fore",
402 | "body": "{% for ${1:item} in ${2:items} %}\n\t$3\n{% else %}\n\t$0\n{% endfor %}",
403 | "description": "for ... else",
404 | "scope": "text.html.twig"
405 | },
406 | "for": {
407 | "prefix": "for",
408 | "body": "{% for ${1:item} in ${2:items} %}\n\t$0\n{% endfor %}",
409 | "description": "for",
410 | "scope": "text.html.twig"
411 | },
412 | "from": {
413 | "prefix": "from",
414 | "body": "{% from '${1:template}' import '${2:macro}' %}$0",
415 | "description": "from",
416 | "scope": "text.html.twig"
417 | },
418 | "getfoothtml": {
419 | "prefix": "getfoothtml",
420 | "body": "{{ getFootHtml() }}\n$0",
421 | "description": "getfoothtml",
422 | "scope": "text.html.twig"
423 | },
424 | "getheadhtml": {
425 | "prefix": "getheadhtml",
426 | "body": "{{ getHeadHtml() }}\n$0",
427 | "description": "getheadhtml",
428 | "scope": "text.html.twig"
429 | },
430 | "if": {
431 | "prefix": "if",
432 | "body": "{% if ${1:condition} %}$2{% endif %}\n$0",
433 | "description": "if",
434 | "scope": "text.html.twig"
435 | },
436 | "ifb": {
437 | "prefix": "ifb",
438 | "body": "{% if ${1:condition} %}\n\t$0\n{% endif %}",
439 | "description": "if (block)",
440 | "scope": "text.html.twig"
441 | },
442 | "ife": {
443 | "prefix": "ife",
444 | "body": "{% if ${1:condition} %}\n\t$2\n{% else %}\n\t$0\n{% endif %}",
445 | "description": "if ... else",
446 | "scope": "text.html.twig"
447 | },
448 | "if1": {
449 | "prefix": "if",
450 | "body": "{% if ${1:condition} %}$0{% endif %}",
451 | "description": "if",
452 | "scope": "text.html.twig"
453 | },
454 | "ifchildren": {
455 | "prefix": "ifchildren",
456 | "body": "{% ifchildren %}\n\t$1\n{% endifchildren %}\n$0",
457 | "description": "ifchildren",
458 | "scope": "text.html.twig"
459 | },
460 | "import": {
461 | "prefix": "import",
462 | "body": "{% import '${1:template}' as ${2:name} %}$0",
463 | "description": "import",
464 | "scope": "text.html.twig"
465 | },
466 | "importself": {
467 | "prefix": "importself",
468 | "body": "{% import _self as ${1:name} %}$0",
469 | "description": "importself",
470 | "scope": "text.html.twig"
471 | },
472 | "inckv": {
473 | "prefix": "inckv",
474 | "body": "{% include '${1:template}' with {\n\t${2:key}: ${3:'${4:value}'}\n} %}\n$0",
475 | "description": "include w/ key/value",
476 | "scope": "text.html.twig"
477 | },
478 | "include": {
479 | "prefix": "include",
480 | "body": "{% include '${1:template}' %}$0",
481 | "description": "include",
482 | "scope": "text.html.twig"
483 | },
484 | "inc": {
485 | "prefix": "inc",
486 | "body": "{% include '${1:template}' %}$0",
487 | "description": "inc",
488 | "scope": "text.html.twig"
489 | },
490 | "incp": {
491 | "prefix": "incp",
492 | "body": "{% include '${1:template}'${2: with ${3:params} }%}$0",
493 | "description": "include w/ params",
494 | "scope": "text.html.twig"
495 | },
496 | "includecss": {
497 | "prefix": "includecss",
498 | "body": "{% includeCssFile \"${1:/resources/css/global.css}\" %}\n$0",
499 | "description": "includeCssFile",
500 | "scope": "text.html.twig"
501 | },
502 | "includecss1": {
503 | "prefix": "includecss",
504 | "body": "{% includehirescss %}\n\t$1\n{% endincludehirescss %}\n$0",
505 | "description": "includeCssHiRes",
506 | "scope": "text.html.twig"
507 | },
508 | "includejs": {
509 | "prefix": "includejs",
510 | "body": "{% includejs %}\n\t$1\n{% endincludejs %}\n$0",
511 | "description": "includeJs",
512 | "scope": "text.html.twig"
513 | },
514 | "includejs1": {
515 | "prefix": "includejs",
516 | "body": "{% includeJsFile \"${1:/resources/js/global.js}\" %}\n$0",
517 | "description": "includeJsFile",
518 | "scope": "text.html.twig"
519 | },
520 | "includecss2": {
521 | "prefix": "includecss",
522 | "body": "{% includecss %}\n\t$1\n{% endincludecss %}\n$0",
523 | "description": "includeCss",
524 | "scope": "text.html.twig"
525 | },
526 | "info5": {
527 | "prefix": "info",
528 | "body": "\n{% set assets = craft.assets.first() %}\n{% set assets = craft.assets.last() %}\n{% set assets = craft.assets.nth( n ) %}\n{% set assets = craft.assets.ids() %}\n{% set assets = craft.assets.total() %}\n\n{% set assets = craft.assets.find({\n\n\tfilename: 'fileName.jpg',\n\tfixedOrder: true|false,\n\tfolderId: id,\n\theight: 200,\n\tid: id,\n\tkind: http://buildwithcraft.com/docs/templating/craft.assets#kind,\n\toffset: 1,\n\tsize: 1000,\n\ttitle: 'title',\n\tsource: 'assetSourceHandle'\n\tsourceId: id,\n\twidth: 200,\n\n\trelatedTo: element, sourceElement, targetElement, field, sourceLocale,\n\tchildOf: See supported syntaxes below,\n\tchildField: 'fieldHandle' OR id,\n\tparentOf: See supported syntaxes below,\n\tparentField: 'fieldHandle' OR id,\n\n\torder: 'title,id,sourceId,folderId,filename,kind,width,height,size,\n\t\t\t\t\t\t\tdateCreated asc,dateUpdated desc', \n\t\t\t\t\t\t\tAlso supports any textual field handles\n\tlimit: 100,\n\tlocale: 'en_us',\n\tindexBy: 'id,title',\n\n\tsearch: 'salty dog' containing both \"salty\" and \"dog\"\n\t\t\t\t\t\t\t'\"salty dog\"' containing the exact phrase \"salty dog\"\n\t\t\t\t\t\t\t'salty OR dog' containing either \"salty\" or \"dog\" (or both)\n\t\t\t\t\t\t\t'salty -dog' containing \"salty\" but not \"dog\"\n\t\t\t\t\t\t\t'body:salty' containing \"salty\" in the \"body\" field\n\t\t\t\t\t\t\t'body:salty' body:dog containing both \"salty\" and \"dog\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin the \"body\" field\n\t\t\t\t\t\t\t'body:*' containing anything within the \"body\" field\n\t\t\t\t\t\t\t'salty locale:en_us' containing \"salty\" in the locale \"en_us\"\n\t\t\t\t\t\t\t'salt*' containing a word that begins with \"salt\"\n\t\t\t\t\t\t\t'*ty' containing a word that ends with \"ty\"\n\t\t\t\t\t\t\t'*alt*' containing a word that contains \"alt\",\n\n\tSupported syntaxes for childOf, kind, parentOf\n\t\t\t\t\t\t\telementId\n\t\t\t\t\t\t\tAssetFileModel, EntryModel, UserModel, or TagModel\n\t\t\t\t\t\t\t[ arrayOfModels, arrayOfModels, arrayOfModels ]\n\t\t\t\t\t\t\t[ 1, 2, 3 ]\n\t\t\t\t\t\t\tcraft.assets, craft.entries, craft.users, craft.tags\n}) %}\n\n{% for asset in assets %}\n\n\t{{ asset.dateCreated }}\n\t{{ asset.dateUpdated }}\n\t{{ asset.extension }}\n\t{{ asset.filename }}\n\t{{ asset.folder }}\n\t{{ asset.folderId }}\n\t{{ asset.height }}\n\t{{ asset.id }}\n\t{{ asset.img }}\n\t{{ asset.kind }}\n\t{{ asset.locale }}\n\t{{ asset.link }}\n\t{{ asset.mimeType }}\n\t{{ asset.size | filesize }}\n\t{{ asset.source }}\n\t{{ asset.sourceId }}\n\t{{ asset.url }}\n\t{{ asset.width }}\n\t\n\t{{ asset.getHeight( transform ) }}\n\t{{ asset.getWidth( transform ) }}\n\t{{ asset.getUrl( transform ) }}\n\t{{ asset.setTransform( transform ) }}\n\n\t{% set prev = asset.getPrev( params ) %}\n\t{% set next = asset.getNext( params ) %}\n\t{% if prev %} {{ prev.title }} {% endif %}\n\t{% if next %} {{ next.title }} {% endif %}\n\t\n{% endfor %}}\n$0",
529 | "description": "info: craft.assets",
530 | "scope": "text.html.twig"
531 | },
532 | "info6": {
533 | "prefix": "info",
534 | "body": "\n{% set categories = craft.categories.first() %}\n{% set categories = craft.categories.last() %}\n{% set categories = craft.categories.nth( n ) %}\n{% set categories = craft.categories.ids() %}\n{% set categories = craft.categories.total() %}\n\n{% set categories = craft.categories.find({\n\tid: id OR 'not id' ,\n\tfixedOrder: true/false,\n\ttitle: 'title',\n\tslug: 'slug', \n\turi: 'uri', \n\tgroup: 'categoryGroupHandle'\n\tgroupId: id,\n\tstatus: 'live,pending,expired,disabled,null',\n\toffset: 10,\n\tlevel: 2,\n\tlocale: 'en_us',\n\n\trelatedTo: element, sourceElement, targetElement, field, sourceLocale,\n\tancestorOf: CategoryModel OR id,\n\tancestorDist: 2,\n\tdescendantOf: CategoryModel OR id,\n\tdescendantDist: 2,\n\tnextSiblingOf: CategoryModel OR id,\n\tprevSiblingOf: CategoryModel OR id,\n\t\n\torder: 'title,id,groupId,slug,uri,\n\t\t\t\t\t\t\t\t\t dateCreated asc,dateUpdated desc',\n\tlimit: 10,\n\tindexBy: 'id,title',\n\n\tsearch: 'salty dog' containing both \"salty\" and \"dog\"\n\t\t\t\t\t\t\t\t\t'\"salty dog\"' containing the exact phrase \"salty dog\"\n\t\t\t\t\t\t\t\t\t'salty OR dog' containing either \"salty\" or \"dog\" (or both)\n\t\t\t\t\t\t\t\t\t'salty -dog' containing \"salty\" but not \"dog\"\n\t\t\t\t\t\t\t\t\t'body:salty' containing \"salty\" in the \"body\" field\n\t\t\t\t\t\t\t\t\t'body:salty' body:dog containing both \"salty\" and \"dog\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin the \"body\" field\n\t\t\t\t\t\t\t\t\t'body:*' containing anything within the \"body\" field\n\t\t\t\t\t\t\t\t\t'salty locale:en_us' containing \"salty\" in the locale \"en_us\"\n\t\t\t\t\t\t\t\t\t'salt*' containing a word that begins with \"salt\"\n\t\t\t\t\t\t\t\t\t'*ty' containing a word that ends with \"ty\"\n\t\t\t\t\t\t\t\t\t'*alt*' containing a word that contains \"alt\"\n\n}) %}\n\n{% for category in categories %}\n\n\t{{ category.id }}\n\t{{ category.level }}\n\t{{ category.groupId }}\n\t{{ category.group }} {# array #}\n\t{{ category.locale }}\n\t{{ category.title }}\n\t{{ category.slug }}\n\t{{ category.uri }}\n\t{{ category.url }} {# full front-end URL #}\n\t{{ category.link }} {# full tag #}\n\t{{ category.cpEditUrl }}\n\t\n\t{{ category.enabled }}\n\t{{ category.status }}\n\n\t{{ category.dateCreated }}\n\t{{ category.dateUpdated }}\n\t\n\t{{ category.getAncestors( distance ) }}\n\t{{ category.getDescendants( distance) }}\n\t{{ category.children }} \n\t{{ category.parent }}\n\t{{ category.hasDescendants }}\n\t{{ category.nextSibling }}\n\t{{ category.prevSibling }}\n\t{{ category.isAncestorOf( entry ) }}\n\t{{ category.isChildOf( entry ) }}\n\t{{ category.isDescendantOf( entry ) }}\n\t{{ category.isNextSiblingOf( entry ) }}\n\t{{ category.isParentOf( entry ) }}\n\t{{ category.isPrevSiblingOf( entry ) }}\n\t{{ category.isSiblingOf( entry ) }}\n\t\n\t{% set prev = category.getPrev( params ) %}\n\t{% set next = category.getNext( params ) %}\n\t{% if prev %} {{ prev.title }} {% endif %}\n\t{% if next %} {{ next.title }} {% endif %}\n\n{% endfor %}}\n$0",
535 | "description": "info: craft.categories",
536 | "scope": "text.html.twig"
537 | },
538 | "info7": {
539 | "prefix": "info",
540 | "body": "\n{% set entries = craft.entries.first() %}\n{% set entries = craft.entries.last() %}\n{% set entries = craft.entries.nth( n ) %}\n{% set entries = craft.entries.ids() %}\n{% set entries = craft.entries.total() %}\n\n{% set entries = craft.entries.find({\n\tid: id OR 'not id' ,\n\tfixedOrder: true/false,\n\tslug: 'slug', \n\turi: 'uri', \n\tsectionId: id,\n\tsection: 'sectionHandle', [arrayOfSectionHandles], SectionModel\n\tauthorId: id,\n\tauthorGroupId: id,\n\tauthorGroup: id,\n\tpostDate: 'YYYY,YYYY-MM,YYYY-MM-DD,YYYY-MM-DD HH:MM,YYYY-MM-DD HH:MM:SS',\n\tafter: 'YYYY,YYYY-MM,YYYY-MM-DD,YYYY-MM-DD HH:MM,YYYY-MM-DD HH:MM:SS',\n\tbefore: 'Unix timestamp,DateTime variable',\n\tstatus: 'live,pending,expired,disabled,null',\n\ttype: 'entryTypeHandle',\n\tarchived: true OR false,\n\toffset: 10,\n\tlevel: 2,\n\tlocale: 'en_us',\n\tlocaleEnabled: true/false,\n\n\trelatedTo: element, sourceElement, targetElement, field, sourceLocale,\n\tancestorOf: EntryModel OR id,\n\tancestorDist: 2,\n\tdescendantOf: EntryModel OR id,\n\tdescendantDist: 2,\n\tnextSiblingOf: EntryModel OR id,\n\tprevSiblingOf: EntryModel OR id,\n\t\n\torder: 'title,id,authorId,sectionId,slug,uri,postDate,expiryDate',\n\t\t\t\t\t\t\t\t\t'dateCreated asc', 'dateUpdated desc'\n\tlimit: 10,\n\tindexBy: 'id,title',\n\n\tsearch: 'salty dog' containing both \"salty\" and \"dog\"\n\t\t\t\t\t\t\t\t\t'\"salty dog\"' containing the exact phrase \"salty dog\"\n\t\t\t\t\t\t\t\t\t'salty OR dog' containing either \"salty\" or \"dog\" (or both)\n\t\t\t\t\t\t\t\t\t'salty -dog' containing \"salty\" but not \"dog\"\n\t\t\t\t\t\t\t\t\t'body:salty' containing \"salty\" in the \"body\" field\n\t\t\t\t\t\t\t\t\t'body:salty' body:dog containing both \"salty\" and \"dog\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin the \"body\" field\n\t\t\t\t\t\t\t\t\t'body:*' containing anything within the \"body\" field\n\t\t\t\t\t\t\t\t\t'salty locale:en_us' containing \"salty\" in the locale \"en_us\"\n\t\t\t\t\t\t\t\t\t'salt*' containing a word that begins with \"salt\"\n\t\t\t\t\t\t\t\t\t'*ty' containing a word that ends with \"ty\"\n\t\t\t\t\t\t\t\t\t'*alt*' containing a word that contains \"alt\"\n\n\tSupported syntaxes for childOf, kind, parentOf\n\t\t\t\t\t\t\t\t\telementId\n\t\t\t\t\t\t\t\t\tAssetFileModel, EntryModel, UserModel, or TagModel\n\t\t\t\t\t\t\t\t\t[ arrayOfModels, arrayOfModels, arrayOfModels ]\n\t\t\t\t\t\t\t\t\t[ 1, 2, 3 ]\n\t\t\t\t\t\t\t\t\tcraft.assets, craft.entries, craft.users, craft.tags\n\n}) %}\n\n{% for entry in entries %}\n\n\t{{ entry.id }}\n\t{{ entry.level }}\n\t{{ entry.sectionId }}\n\t{{ entry.section }} {# array #}\n\t{{ entry.authorId }}\n\t{{ entry.author }} {# array #}\n\t{{ entry.locale }}\n\t{{ entry.type }}\n\t{{ entry.title }}\n\t{{ entry.slug }}\n\t{{ entry.uri }}\n\t{{ entry.url }} {# full front-end URL #}\n\t{{ entry.link }} {# full tag #}\n\t{{ entry.cpEditUrl }}\n\t\n\t{{ entry.enabled }}\n\t{{ entry.status }}\n\n\t{{ entry.postDate }}\n\t{{ entry.expiryDate }}\n\t{{ entry.dateCreated }}\n\t{{ entry.dateUpdated }}\n\t\n\t{{ entry.getAncestors( distance ) }}\n\t{{ entry.getDescendants( distance) }}\n\t{{ entry.children }}\n\t{{ entry.parent }}\n\t{{ entry.hasDescendants }}\n\t{{ entry.nextSibling }}\n\t{{ entry.prevSibling }}\n\t{{ entry.isAncestorOf( entry ) }}\n\t{{ entry.isChildOf( entry ) }}\n\t{{ entry.isDescendantOf( entry ) }}\n\t{{ entry.isNextSiblingOf( entry ) }}\n\t{{ entry.isParentOf( entry ) }}\n\t{{ entry.isPrevSiblingOf( entry ) }}\n\t{{ entry.isSiblingOf( entry ) }}\n\t\n\t{% set prev = entry.getPrev( params ) %}\n\t{% set next = entry.getNext( params ) %}\n\t{% if prev %} {{ prev.title }} {% endif %}\n\t{% if next %} {{ next.title }} {% endif %}\n\n{% endfor %}}\n$0",
541 | "description": "info: craft.entries",
542 | "scope": "text.html.twig"
543 | },
544 | "info8": {
545 | "prefix": "info",
546 | "body": "{# Required #}\n{% set feedUrl = \"http://feeds.feedburner.com/blogandtonic\" %}\n\n{# Option #}\n{% set limit = 10 %} {# How many items to return. Default: All #}\n{% set skip = 0 %} {# How many items to skip. Default: Zero #}\n\n{% set items = craft.feeds.getFeedItems( url, limit, offset, cacheDuration ) %}\n\n{% for item in items %}\n\t\n\t{{ title }}\n\t{{ summary }}\n\t{{ content }}\n\n\t{{ date }}\n\t{{ dateUpdated }}\n\t{{ permalink }}\n\t\n\t{{ authors }} {# array #}\n\t{{ authors[0].name }}\n\t{{ authors[0].url }}\n\t{{ authors[0].email }}\n\n\t{{ contributors }} {# array #}\n\t{{ contributors[0].name }}\n\t{{ contributors[0].url }}\n\t{{ contributors[0].email }}\n\n\t{{ categories }} {# array #}\n\t{{ categories[0].term }}\n\t{{ categories[0].scheme }}\n\t{{ categories[0].label }}\n\n{% endfor %}\n$0",
547 | "description": "info: craft.feeds",
548 | "scope": "text.html.twig"
549 | },
550 | "info9": {
551 | "prefix": "info",
552 | "body": "{# Properties #}\n{{ craft.request.isAjax }}\n{{ craft.request.isLivePreview }}\n{{ craft.request.isSecure }}\n\n{{ craft.request.path }}\n{{ craft.request.url }}\n{{ craft.request.urlReferrer }}\n{{ craft.request.pageNum }}\n\n{{ craft.request.queryString }}\n{{ craft.request.queryStringWithoutPath }}\n{{ craft.request.segments }} {# array #}\n\n{{ craft.request.firstSegment }}\n{{ craft.request.lastSegment }}\n\n{{ craft.request.serverName }}\n\n{# Methods #}\n{{ craft.request.isMobileBrowser() }}\n\n{{ craft.request.getSegment( n ) }}\n{{ craft.request.getCookie( name ) }}\n{{ craft.request.getParam( name ) }} {# Returns a parameter from either the query string or POST data. #}\n{{ craft.request.getQuery( name ) }} {# Returns a parameter from the query string. #}\n{{ craft.request.getPost( name ) }} {# Returns a parameter from the POST data. #}\n\n$0",
553 | "description": "info: craft.request",
554 | "scope": "text.html.twig"
555 | },
556 | "info10": {
557 | "prefix": "info",
558 | "body": "\n{% set tags = craft.tags.first() %}\n{% set tags = craft.tags.last() %}\n{% set tags = craft.tags.nth( n ) %}\n{% set tags = craft.tags.ids() %}\n{% set tags = craft.tags.total() %}\n\n{% set tags = craft.tags.find({\n\tid: id OR 'not id' ,\n\tfixedOrder: true|false,\n\ttitle: 'title',\n\tgroup: 'tagGroupHandle', \n\tgroupId: id,\n\toffset: 2,\n\t\n\trelatedTo: element, sourceElement, targetElement, field, sourceLocale,\n\n\torder: 'title,id,groupId,dateCreated asc,dateUpdated desc',\n\tlimit: 10,\n\tlocale: 'en_us',\n\tindexBy: 'id,title',\n\n\tsearch: 'salty dog' containing both \"salty\" and \"dog\"\n\t\t\t\t\t\t\t\t\t'\"salty dog\"' containing the exact phrase \"salty dog\"\n\t\t\t\t\t\t\t\t\t'salty OR dog' containing either \"salty\" or \"dog\" (or both)\n\t\t\t\t\t\t\t\t\t'salty -dog' containing \"salty\" but not \"dog\"\n\t\t\t\t\t\t\t\t\t'body:salty' containing \"salty\" in the \"body\" field\n\t\t\t\t\t\t\t\t\t'body:salty' body:dog containing both \"salty\" and \"dog\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin the \"body\" field\n\t\t\t\t\t\t\t\t\t'body:*' containing anything within the \"body\" field\n\t\t\t\t\t\t\t\t\t'salty locale:en_us' containing \"salty\" in the locale \"en_us\"\n\t\t\t\t\t\t\t\t\t'salt*' containing a word that begins with \"salt\"\n\t\t\t\t\t\t\t\t\t'*ty' containing a word that ends with \"ty\"\n\t\t\t\t\t\t\t\t\t'*alt*' containing a word that contains \"alt\"\n\n\tSupported syntaxes for childOf, kind, parentOf\n\t\t\t\t\t\t\t\t\telementId\n\t\t\t\t\t\t\t\t\tAssetFileModel, EntryModel, UserModel, or TagModel\n\t\t\t\t\t\t\t\t\t[ arrayOfModels, arrayOfModels, arrayOfModels ]\n\t\t\t\t\t\t\t\t\t[ 1, 2, 3 ]\n\t\t\t\t\t\t\t\t\tcraft.assets, craft.entries, craft.users, craft.tags\n\n}) %}\n\n{% for tag in tags %}\n\n\t{{ tag.id }}\n\t{{ tag.title }}\n\t{{ tag.group }}\n\t{{ tag.groupId }}\n\t{{ tag.locale }}\n\n\t{% set prev = tag.getPrev( params ) %}\n\t{% set next = tag.getNext( params ) %}\n\t{% if prev %} {{ prev.name }} {% endif %}\n\t{% if next %} {{ next.name }} {% endif %}\n\n{% endfor %}}\n$0",
559 | "description": "info: craft.tags",
560 | "scope": "text.html.twig"
561 | },
562 | "info11": {
563 | "prefix": "info",
564 | "body": "\n{% set users = craft.users.first() %}\n{% set users = craft.users.last() %}\n{% set users = craft.users.nth( n ) %}\n{% set users = craft.users.ids() %}\n{% set users = craft.users.total() %}\n\n{% set users = craft.users.find({\n admin: true OR false,\n can: 'createEntries:5'\n email: 'email',\n firstName: 'firstName',\n group: 'groupHandle', \n groupId: id,\n id: id OR 'not id',\n fixedOrder: true|false,\n lastLoginDate: 'YYYY,YYYY-MM,YYYY-MM-DD,YYYY-MM-DD HH:MM,YYYY-MM-DD HH:MM:SS',\n lastName: 'lastName',\n offset: 1,\n status: 'active,locked,suspended,pending,archived,null',\n username: 'username,\n \n relatedTo: element, sourceElement, targetElement, field, sourceLocale,\n \n order: 'username,firstName,lastName,email,preferredLocale,status,lastLoginDate,\n dateCreated asc,dateUpdated desc', \n limit: number,\n indexBy: 'id,username'\n\n search: 'salty dog' containing both \"salty\" and \"dog\"\n '\"salty dog\"' containing the exact phrase \"salty dog\"\n 'salty OR dog' containing either \"salty\" or \"dog\" (or both)\n 'salty -dog' containing \"salty\" but not \"dog\"\n 'body:salty' containing \"salty\" in the \"body\" field\n 'body:salty' body:dog containing both \"salty\" and \"dog\" \n in the \"body\" field\n 'body:*' containing anything within the \"body\" field\n 'salty locale:en_us' containing \"salty\" in the locale \"en_us\"\n 'salt*' containing a word that begins with \"salt\"\n '*ty' containing a word that ends with \"ty\"\n '*alt*' containing a word that contains \"alt\",\n\n}) %}\n\n{% for user in users %}\n \n {{ user.id }}\n {{ user.username }}\n {{ user.name }}\n {{ user.firstName }}\n {{ user.lastName }}\n {{ user.fullName }}\n {{ user.friendlyName }} {# falls back to username #}\n {{ user.email }}\n \n {{ user.preferredLocale }}\n {{ user.admin }} {# true,false #}\n {{ user.status }} {# active, locked, suspended, pending, archived #}\n {{ user.isCurrent }} {# is currently logged in #}\n \n {{ user.lastLoginDate }}\n {{ user.dateCreated }}\n {{ user.dateUpdated }}\n\n {{ user.getChildren( fields ) }}\n {{ user.getParents( fields ) }}\n\n {{ user.getGroups() }}\n {{ user.isInGroup( groupHandle OR groupId OR UserGroupModel ) }}\n {{ user.getPhotoUrl( size ) }}\n {{ user.isCurrent() }}\n {{ user.can( 'permission' ) }}\n\n {% set prev = user.getPrev( params ) %}\n {% set next = user.getNext( params ) %}\n {% if prev %} {{ prev.username }} {% endif %}\n {% if next %} {{ next.username }} {% endif %}\n\n{% endfor %}}\n$0",
565 | "description": "info: craft.users",
566 | "scope": "text.html.twig"
567 | },
568 | "info12": {
569 | "prefix": "info",
570 | "body": "\nSITE\n{{ siteName }}\n{{ siteUrl }}\n{{ loginUrl }}\n{{ logoutUrl }}\n\nDATE\n{{ now.year }}\n{{ now.month }}\n{{ now.day }}\n{{ now|date(\"M d, Y\") }}\n{{ now|date_modify(\"+1 day\") }}\n\nUSERS\n{{ currentUser }} {# null if no user is logged in #}\n{{ currentUser.id }}\n{{ currentUser.username }}\n{{ currentUser.firstName }}\n{{ currentUser.lastName }}\n{{ currentUser.friendlyName }}\n{{ currentUser.email }}\n{{ currentUser.preferredLocale }}\n{{ currentUser.admin }}\n{{ currentUser.status }} {# active, locked, suspended, pending, archived #}\n{{ currentUser.lastLoginDate }}\n{{ currentUser.dateCreated }}\n{{ currentUser.dateUpdated }}\n\n{{ currentUser.getChildren() }}\n{{ currentUser.getParents() }}\n\n{% set params = { group: 'authors', order: 'firstName, lastName' } %}\n{{ currentUser.getNext( params ) }}\n{{ currentUser.getPrev( params ) }}\n\nGLOBALS\n{{ globalSetName.fieldName }}\n\nTAGS\n{{ craft.assets }}\n{{ craft.categories }}\n{{ craft.entries }}\n{{ craft.tags }}\n{{ craft.user }}\n\n{{ craft.config }}\n{{ craft.feeds }}\n{{ craft.fields }}\n{{ craft.globals }}\n{{ craft.request }}\n{{ craft.sections }}\n{{ craft.session }}\n\n$0",
571 | "description": "info: globals",
572 | "scope": "text.html.twig"
573 | },
574 | "macro": {
575 | "prefix": "macro",
576 | "body": "{% macro ${1:name}(${2:params}) %}\n\t$0\n{% endmacro %}",
577 | "description": "macro",
578 | "scope": "text.html.twig"
579 | },
580 | "matrix": {
581 | "prefix": "matrix",
582 | "body": "{% for block in ${1:entry.matrixFieldHandle} %}\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",
583 | "description": "matrix",
584 | "scope": "text.html.twig"
585 | },
586 | "matrixif": {
587 | "prefix": "matrixif",
588 | "body": "{% for block in ${1:entry.matrixFieldHandle} %}\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",
589 | "description": "matrixif",
590 | "scope": "text.html.twig"
591 | },
592 | "matrixifelse": {
593 | "prefix": "matrixifelse",
594 | "body": "{% for block in ${1:entry.matrixFieldHandle} %}\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 %}",
595 | "description": "matrixifelse",
596 | "scope": "text.html.twig"
597 | },
598 | "matrixswitch": {
599 | "prefix": "matrixswitch",
600 | "body": "{% for block in ${1:entry.matrixFieldHandle} %}\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 %}",
601 | "description": "matrixswitch",
602 | "scope": "text.html.twig"
603 | },
604 | "max": {
605 | "prefix": "max",
606 | "body": "max(${1:$2, $3})$0",
607 | "description": "max",
608 | "scope": "text.html.twig"
609 | },
610 | "min": {
611 | "prefix": "min",
612 | "body": "min(${1:$2, $3})$0",
613 | "description": "min",
614 | "scope": "text.html.twig"
615 | },
616 | "nav": {
617 | "prefix": "nav",
618 | "body": "{% nav ${1:item} in ${2:items} %}\n\t$3\n{% endnav %}\n$0",
619 | "description": "nav",
620 | "scope": "text.html.twig"
621 | },
622 | "paginate": {
623 | "prefix": "paginate",
624 | "body": "{% paginate ${1:elements} as ${2:pageInfo}, ${3:name} %}\n\n{% for item in ${3:name} %}\n\t$0\n{% endfor %}\n\n{% if ${2:pageInfo}.prevUrl %}Previous Page{% endif %}\n{% if ${2:pageInfo}.nextUrl %}Next Page{% endif %}",
625 | "description": "paginate simple",
626 | "scope": "text.html.twig"
627 | },
628 | "paginate1": {
629 | "prefix": "paginate",
630 | "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