Skip to content
Craft CMS Package for Atom
Branch: master
Clone or download
shornuk Merge pull request #12 from nfourtythree/master
[Added] paginate and cache tag snippets and highlighting fixes #11
Latest commit 65c7893 Oct 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
grammars
settings
snippets [Added] cache tag snippet and syntax highlighting Oct 1, 2018
CHANGELOG.md Update to include else Feb 11, 2016
README.md [Added] Added import tag Feb 27, 2017
package.json Prepare 0.4.0 release Mar 1, 2017

README.md

Craft CMS Package for Atom

Add snippets and template tags for the Craft CMS to Twig & HTML files in Atom.

A port from BarrelStrength Craft-Twig.tmbundle for sublime.

Twig Tags (via tab trigger)

}}              {{  }}
%%              {%  %}
##              {#  #}

extends         {% extends 'template' %}
inc             {% include 'template' with vars %}
incp            {% include 'template' with {
                  key: 'value'
                }} %}

set, setb       {% set var = value %}
block, blockb   {% block name %} ... {% endblock %}
filter, filterb {% filter name %} ... {% endfilter %}

if, ifb         {% if condition %} ... {% endif %}
ife             {% if condition %} ... {% else %} ... {% endif %}
import          {% import 'template' as key %}
for             {% for item in seq %} ... {% endfor %}
fore            {% for item in seq %} ... {% else %} ... {% endfor %}
else            {% else %}

endif           {% endif %}
endfor          {% endfor %}
endset          {% endset %}
endblock        {% endblock %}
endfilter       {% endfilter %}

Twig Tags, Customized for Craft (via tab trigger)

assets, assetsp          craft.assets loop
categories, categoriesp  craft.categories loop
entries, entriesp        craft.entries loop
feed                     craft.feeds.getFeedItems loop
tags, tagsp              craft.tags loop
users, usersp            craft.users loop

ciel               ceil()
csrf               {{ getCsrfInput() }}
exit               {% exit 404 %}
endmacro           {% endmacro %}
floor              floor()
includecss         {% includecss %} ... {% endincludecss %}
includecssfile     {% includeCssFile "/resources/css/global.css" %}
includecsshires    {% includehirescss %} ... {% endincludehirescss %}
includejs          {% includejs %} ... {% endincludejs %}

includejsfile      {% includeJsFile "/resources/css/global.css" %}
macro              {% macro name(param) %} ... {% endmacro %}
includejs          {% includeJsFile "/resources/css/global.css" %}
matrix             Outputs a basic Matrix Field loop
max                max()
min                min()
paginate           Simple:   Outputs an example of pagination with craft.entries
                   Advanced: Outputs an example of pagination with craft.entries
redirect           {% redirect 'login' %}
getparam           craft.request.getParam()
getpost            craft.request.getPost()
getquery           craft.request.getQuery()
getsegment         craft.request.getSegment()
requirelogin       {% requireLogin %}
requirepermission  {% requirePermission "spendTheNight" %}
round              round()
shuffle            shuffle()
switch             {% switch variable %}{% endswitch %}
url, urla          url('path'), url('path', params, 'http', false)
You can’t perform that action at this time.