PHPackages                             stillat/statamic-template-resolver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. stillat/statamic-template-resolver

ActiveLibrary

stillat/statamic-template-resolver
==================================

v1.2.0(7mo ago)05.7k↓50%3MITPHPPHP ^8.0

Since Nov 4Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/Stillat/statamic-template-resolver)[ Packagist](https://packagist.org/packages/stillat/statamic-template-resolver)[ GitHub Sponsors](https://github.com/JohnathonKoster)[ RSS](/packages/stillat-statamic-template-resolver/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (3)

Template Resolver for Statamic
==============================

[](#template-resolver-for-statamic)

Template Resolver for Statamic is a simple utility addon, intended to be used by other addons. It provides a simple utility for selecting and rendering a template based on an entry's *blueprint* and *collection*, with support for a fallback default template.

Example use-cases:

- Selecting templates dynamically to generate social media images from HTML,
- Generating HTML documents on-the-fly, without requiring network requests to the site,
- Anything where you need to support customizable templates based on an entry's blueprint/collection details

How to Install
--------------

[](#how-to-install)

Run the following command from your project root:

```
composer require stillat/statamic-template-resolver
```

How to Use
----------

[](#how-to-use)

You need to create an instance of `StringTemplateManager`, and supply the directory to search for templates in.

```
