bootsified / craft-widow-no-mo
Preventz 'widows' in ur outputz.
Installs: 144
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:craft-plugin
Requires
- craftcms/cms: ^3.0.0-RC1
This package is not auto-updated.
Last update: 2024-09-29 05:42:01 UTC
README
Preventz 'widows' in ur outputz.
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
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.
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 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