postyou / headline-tiny-mce
HTML headline for Contao
Installs: 127
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:contao-bundle
Requires
- php: ^8.0
- contao-components/tinymce4: ^6.1
- contao/core-bundle: ^5.0
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- friendsofphp/php-cs-fixer: ^3.12
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
README
This Contao CMS extension adds a small TinyMCE editor to all DCA headline
fields and allows HTML tags for them.
Template
The be_tinyHeadlineMCE.html5
template is used by default. It restricts the menu and the valid elements. Only phrasing content should be allowed inside of HTML headings.
Since TinyMce 6 the option to disable forced_root_block
is no longer available. The headline is now always saved with a surrounding <p>
tag. For this reason we use striptags
to remove all tags that are not allowed in be_tinyHeadlineMCE.html5
:
// be_tinyHeadlineMCE.html5 valid_elements: 'a[href|target|title],strong,em,span[style],br',
{# @Contao/component/_headline.html.twig #} {{ headline.text|...|striptags('<a><strong><em><span><br>')|raw }}