Widow No Mo plugin for Craft CMS 3.x
Preventz 'widows' in ur outputz., (*1)
, (*2)
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later., (*3)
Installation
To install the plugin, follow these instructions., (*4)
-
Open your terminal and go to your Craft project:, (*5)
cd /path/to/project
-
Then tell Composer to load the plugin:, (*6)
composer require bootsified/craft-widow-no-mo
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for craft-widow-no-mo., (*7)
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'., (*8)
Using Widow No Mo
Use the widownomo
filter on your string..., (*9)
{% 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..., (*10)
<p>This is a string of text that might create a widow when the page is too narrow.</p>
Credit
This is basically Craft v3 verion of the Craft-Widont plugin from Alexander Bech. All props go to him. :raised_hands:, (*11)
Brought to you by Boots, (*12)