Plugin screenshot thumbnail 1/1

Configuring Template Select

Create a new field and choose field type Template Select.

In the field settings, you can limit the list of available templates to a subfolder of the Craft templates folder. The path is relative, i.e. subfolder/anotherfolder. This may also be set to an ENV variable.

In the field settings, you can choose to make the template names more user friendly. In the field, the list will be improved by changing the following:

  • file extensions will be removed
  • the file names will be capitalized and spaced for readability
  • folders will be separated by ›

Using Template Select

Output the chosen template name:

{{ entry.fieldHandle }}

Include/Embed the chosen template:

{% include entry.fieldHandle %}

Include the template including subfolder if set:

{% include entry.fieldHandle.withSubfolder() %}

This is a alias for the following:

{{ entry.templateWithSubfolder.template(true) }}

Output the subfolder name:

{{ entry.fieldHandle.subfolder() }}

Output the filename without path:

{{ entry.fieldHandle.filename() }}
Installation Instructions

To install this plugin, copy the command above to your terminal.

Active Installs
550
Version
3.0.0
License
MIT
Compatibility
Craft 3, Craft 4, Craft 5
Last release
October 3, 2022
Categories
Activity (30 days)
5
Closed Issues
1
Open Issues
1
Merged PRs
1
Open PRs