ISML Completion

Tag, attribute, value, template path, custom tag and expression completion in ISML templates, plus the ISML live templates and postfix templates

Completion in a template knows the 32 ISML tags, their attributes and values, every template of the linked cartridges, the custom tags this template can use and the Script API inside expressions. Every item has quick documentation beside the list

Tag names complete after < with their required attributes as grey text. Accepting a tag writes those attributes and puts the caret in the first value

Tags

Tag names complete after < and </. Required attributes show as grey text after the name, and deprecated tags are struck out. Accepting a tag writes its required attributes and puts the caret in the first value, so isslot gives <isslot id="" context="" with the caret in id

After </ only tags that take a body are offered. Custom tags such as <isproducttile> complete next to the built-in ones, with their module template as the type text, see Custom Tags

Attributes and values

Inside a tag the attribute list comes from the tag catalog. Required attributes come first in bold, and once one attribute of a group is present the others leave the list, so <isinclude template> no longer offers url. Accepting an attribute writes ="", or ="${}" for an attribute that takes an expression

Type textValue
${...}An expression, such as condition or items
templateA template path
A list of valuesA fixed set, such as relative|daily for <iscache type>
nameA variable name, such as <isset name>
route or URLA route or a URL

Values complete for attributes with a fixed set, and for true and false on boolean attributes. Each value shows the first sentence of its description, so the 17 encoding values of <isprint> say where each one fits. Matching ignores case

Template paths

The template value of <isinclude>, <isdecorate> and <ismodule> completes every template of the linked cartridges, relative to templates/<locale> and without .isml. Folder prefixes and a leading / work

Type textMeans
app_storefront_baseOnly this cartridge has the path
app_custom +1The first cartridge that has it, and how many more cartridges have the same path

The same paths complete in scripts, for example in res.render('cart/cart'), see SFCC Contracts

Expressions

Inside ${...} and <isscript> completion offers the template's variables, pdict members, the implicit names Resource, URLUtils, StringUtils and out, imported classes and the members of the Script API. SFCC strings complete too, so ${URLUtils.url('Cart-Show')} completes the route and ${Resource.msg('button.checkout', 'cart', null)} the key. See Scripting in ISML for where the types come from

Live templates

The ISML group in Settings › Editor › Live Templates expands with Tab, and the items also show in completion

AbbreviationExpands to
isif, isife, isifel<isif>, with an <iselse> branch, or with <iselseif> and <iselse>
isloop, isloops<isloop>, and with status="loop". The variable is named after the items
isset<isset> in page scope
isprint<isprint> with an encoding
isinc, isincu<isinclude> of a template, or of a route with URLUtils.url
isdec, isrep<isdecorate> and <isreplace/>
ismodAn <ismodule> custom tag declaration
isscr, iscom<isscript> and <iscomment>
iscont, iscache<iscontent> for HTML and <iscache> for 24 hours
isslot, isobj<isslot> in global context and <isobject>
isres, isurlResource.msg(...) and URLUtils.url(...), inside an expression

The fields complete as you go: template paths, routes, resource bundles and keys, and the values of an attribute. The field suggestions need a license, the templates themselves don't

Postfix templates

Typed after an expression inside ${...}, a postfix template turns it into a tag:

TemplateTurns ${pdict.products} into
.isif<isif condition="${pdict.products}"></isif>
.notempty<isif condition="${!empty(pdict.products)}"></isif>
.isloop<isloop items="${pdict.products}" var="product"></isloop>
.isprint<isprint value="${pdict.products}" encoding=""/>
.isset<isset name="" value="${pdict.products}" scope="page"/>

On this page