PHPackages                             konekt/smarty3-include-if-exists - 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. [Templating &amp; Views](/categories/templating)
4. /
5. konekt/smarty3-include-if-exists

ActiveLibrary[Templating &amp; Views](/categories/templating)

konekt/smarty3-include-if-exists
================================

Smarty v3 plugin for specifying conditional inclusion of subtemplates within smarty templates

1.1.2(10y ago)68.5k5[1 issues](https://github.com/fulopattila122/smarty3-include-if-exists/issues)MITPHPPHP &gt;=5.2

Since Apr 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fulopattila122/smarty3-include-if-exists)[ Packagist](https://packagist.org/packages/konekt/smarty3-include-if-exists)[ RSS](/packages/konekt-smarty3-include-if-exists/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Include If Exists compiler plugin for Smarty v3
===============================================

[](#include-if-exists-compiler-plugin-for-smarty-v3)

Summary
-------

[](#summary)

This is a smarty v3 plugin for specifying conditional inclusion of subtemplates within smarty templates.

[For a similar plugin for smarty v2 click here](http://code.google.com/p/smartyplugin-include-if-exists/)

Usage
-----

[](#usage)

Use the following syntax in smarty templates: `{include_if_exists file="foo.tpl" else="bar.tpl"}`

Installation
------------

[](#installation)

1. The easy way: copy the file compiler.include\_if\_exists.php in your smarty plugins directory.
2. The silky way:
    - put the file compiler.include\_if\_exists.php in an arbitrary folder
    - add the plugin dir to smarty upon initialization `$smarty->addPluginsDir("your/path/to/the/files");`

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 70% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

4

Last Release

3655d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c398dd02c93ecf6aa344f367f5744aeb32b4c7bbc23b1b22e95336f45bf0d5a?d=identicon)[konekt](/maintainers/konekt)

---

Top Contributors

[![fulopattila122](https://avatars.githubusercontent.com/u/1162360?v=4)](https://github.com/fulopattila122 "fulopattila122 (7 commits)")[![uwetews](https://avatars.githubusercontent.com/u/1246127?v=4)](https://github.com/uwetews "uwetews (2 commits)")[![mazzucode](https://avatars.githubusercontent.com/u/3603345?v=4)](https://github.com/mazzucode "mazzucode (1 commits)")

---

Tags

smarty

### Embed Badge

![Health badge](/badges/konekt-smarty3-include-if-exists/health.svg)

```
[![Health](https://phpackages.com/badges/konekt-smarty3-include-if-exists/health.svg)](https://phpackages.com/packages/konekt-smarty3-include-if-exists)
```

###  Alternatives

[ytake/laravel-smarty

Smarty template engine for Laravel and Lumen

87401.6k](/packages/ytake-laravel-smarty)[noiselabs/smarty-bundle

This Symfony bundle provides integration for the Smarty3 template engine.

53194.4k1](/packages/noiselabs-smarty-bundle)[text/template

Simple and secure string-template-engine (Twig-like syntax) with nested if/elseif/else, loops, filters. Simple OOP api: Just one class doing the job (2-lines of code). Fast and secure: No code-generation, no eval'ed() code. Extensible by callbacks. Fully tested. Rich examples included.

38201.1k10](/packages/text-template)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
