bootsified/craft-widow-no-mo

Preventz 'widows' in ur outputz.

1.0.2 2018-06-22 20:51 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:42:01 UTC


README

Preventz 'widows' in ur outputz.

Logo

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

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 bootsified/craft-widow-no-mo
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for craft-widow-no-mo.

Widow No Mo Overview

A 'widow' is when a single word in a block of text breaks to a line on it's own in your page. This filter places a   between the last words of your string to insure that they break together, leaving both on the next line - no 'widows'.

Using Widow No Mo

Use the widownomo filter on your string...

{% set myString = '<p>This is a string of text that might create a widow when the page is too narrow.</p>' %}
{{ myString | widownomo }}

...to prevent widows in the output...

<p>This is a string of text that might create a widow when the page is too&nbsp;narrow.</p>

Credit

This is basically Craft v3 verion of the Craft-Widont plugin from Alexander Bech. All props go to him. 🙌

Brought to you by Boots