belniakmedia/craft-allow-nbsp-twig-filter

Unescape escaped nbsp entities via twig filter.

1.0.1 2022-09-22 19:24 UTC

This package is auto-updated.

Last update: 2024-04-27 07:40:32 UTC


README

This twig filter, when applied to an escaped twig string will un-escape the & entity that the & in " " was converted to by the initial escaping process. This allows content editors to insert their own non-breaking space into fields to prevent text widows on rendered pages.

Requirements

This plugin requires Craft CMS 4.0.0 or later. (See tag 1.0.0 for Caft CMS 3.x)

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require belniakmedia/craft-allow-nbsp-twig-filter
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Allow   Twig Filter.

Allow   Twig Filter Overview

We wanted a quick and easy way for our content editors to be able to insert   entities manually without having them be escaped by the standard twig escape policy. This allows the standard escaping to happen and just unescapes   back to  

Using Allow   Twig Filter

Craft Template Example:

{{ entry.description | allowNbsp }}

Brought to you by Belniak Media, Inc.