Download the PHP package dd/evolutioncms-snippets-ddtypograph without Composer
On this page you can find all versions of the php package dd/evolutioncms-snippets-ddtypograph. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dd/evolutioncms-snippets-ddtypograph
More information about dd/evolutioncms-snippets-ddtypograph
Files in dd/evolutioncms-snippets-ddtypograph
Package evolutioncms-snippets-ddtypograph
Short Description Snippet for text typography. The snippet doesn't use third-party services, also it sends no requests. In other words, everything is performed on your server.
License
Homepage https://code.divandesign.ru/modx/ddtypograph
Informations about the package evolutioncms-snippets-ddtypograph
(MODX)EvolutionCMS.snippets.ddTypograph
Snippet for text typography. The snippet doesn’t use third-party services, also it sends no requests. In other words, everything is performed on your server.
You can turn off typography for a text fragment using the <notg></notg> or <span class="notg"></span> tags.
Requires
- PHP >= 5.6
- (MODX)EvolutionCMS.libraries.ddTools >= 0.48.1
- PHP.libraries.EMT 3.5 (contains in archive)
Installation
Using (MODX)EvolutionCMS.libraries.ddInstaller
Just run the following PHP code in your sources or Console:
- If
ddTypographis not exist on your site,ddInstallerwill just install it. - If
ddTypographis already exist on your site,ddInstallerwill check it version and update it if needed.
Manually
1. Elements → Snippets: Create a new snippet with the following data
- Snippet name:
ddTypograph. - Description:
<b>2.7.1</b> Snippet for text typography. The snippet doesn’t use third-party services, also it sends no requests. In other words, everything is performed on your server.. - Category:
Core. - Parse DocBlock:
no. - Snippet code (php): Insert content of the
ddTypograph_snippet.phpfile from the archive.
2. Elements → Manage Files
- Create a new folder
assets/snippets/ddTypograph/. - Extract the archive to the folder (except
ddTypograph_snippet.php).
Parameters description
-
text- Description: Text to correct.
- Valid values:
string - Required
-
optAlign- Description: Optical alignment (hanging punctuation).
- Valid values:
01
- Default value:
0
-
optAlign_useClasses-
Description: Use CSS classes instead of inline styles for optical alignment (
<span class="oa_comma_b">instead of<span style="margin-right:-0.2em;">).
If the parameter is enabled, don't forget to specify the following CSS rules on your site: - Valid values:
01
- Default value:
0
-
-
text_paragraphs- Description: Section signs and line breaks insertion.
- Valid values:
01
- Default value:
0
-
text_autoLinks- Description: Marking links (including email ones).
- Valid values:
01
- Default value:
0
-
etc_unicodeConvert- Description: Convert HTML entities into Unicode (
—instead of—, etc). - Valid values:
01
- Default value:
1
- Description: Convert HTML entities into Unicode (
-
noTags- Description: Whether HTML element insertion is allowed or not.
There are cases when using tags causes the text to be invalid, for example, using the snippet inside of an HTML attribute. - Valid values:
01
- Default value:
0
- Description: Whether HTML element insertion is allowed or not.
excludeTags- Description: HTML tags which content will be ignored by snippet.
- Valid values:
stringCommaSeparated - Default value:
'notg,code'
Examples
Typography the content
Typography text with auto paragraphs, links & emails
Typography text with auto optical margin alignment (hanging quotes & etc)
Turn off typography for a text fragment (the <notg></notg> or <span class="notg"></span> tags)
Run the snippet through \DDTools\Snippet::runSnippet without DB and eval
Returns: