The template object
The template
object contains information about the currently active template.
Outputting the template
object itself returns the file name of the template used to render the current page, with the .liquid
or .json
extension omitted.
The template
object has the following attributes:
template.directory
Anchor link to section titled "template.directory"Returns the name of the template's parent directory. Returns nil
for templates whose
parent directory is the /templates
folder.
template.name
Anchor link to section titled "template.name"Returns the name of the template's base type.
template.suffix
Anchor link to section titled "template.suffix"Returns the custom name of an alternate template. Returns nil
if an alternate template is not being used.