PHPackages                             ahebrank/newcity\_twig - 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. ahebrank/newcity\_twig

ActiveDrupal-module[Templating &amp; Views](/categories/templating)

ahebrank/newcity\_twig
======================

Useful Drupal 8 Twig extensions

02.1kPHP

Since May 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ahebrank/newcity_twig)[ Packagist](https://packagist.org/packages/ahebrank/newcity_twig)[ RSS](/packages/ahebrank-newcity-twig/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

NewCity Twig Extensions
=======================

[](#newcity-twig-extensions)

A Drupal 8 module to provide some useful Twig extensions and functions

Currently includes:

Extensions
----------

[](#extensions)

### Render helpers

[](#render-helpers)

- `resize(style)`: resize an image with an image style; returns image render array
- `flattenfield`: traverse and flatten a render array
- `smarttrim(wordCount)`: a smarter truncation function (Example: `content.field_text|render|striptags|smarttrim(n)`)
- `alias`: get path alias for an entity

### Project-specific but potentially useful

[](#project-specific-but-potentially-useful)

- `multilinesuperhead`: Break a multiline heading by wrapping all words except the last in ``

### Debug helpers

[](#debug-helpers)

- `nocomment` : removes HTML comments from markup
- `firstlevel` : debug dump only the top level of a render array

Functions
---------

[](#functions)

- `uniqid()` : generate a unique ID with PHP's `uniqid()`

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5023646?v=4)[ahebrank](/maintainers/ahebrank)[@ahebrank](https://github.com/ahebrank)

---

Top Contributors

[![ahebrank](https://avatars.githubusercontent.com/u/5023646?v=4)](https://github.com/ahebrank "ahebrank (25 commits)")

---

Tags

drupaldrupal-8drupal-moduletwig-extension

### Embed Badge

![Health badge](/badges/ahebrank-newcity-twig/health.svg)

```
[![Health](https://phpackages.com/badges/ahebrank-newcity-twig/health.svg)](https://phpackages.com/packages/ahebrank-newcity-twig)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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