Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EditorExtension #21

Merged

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Jan 11, 2020

This will add a editor and editor_classes twig filter.

editor

Will wrap the given html with a div with a specific class.

editor_classes

Will add classes to specific tags.

@alexander-schranz
Copy link
Member Author

alexander-schranz commented Jan 11, 2020

Failing tests has nothing todo with this PR the IntlExtension doesn't work like expected see: symfony/symfony#35309. Fixed in #22

{
return [
new TwigFilter('editor', [$this, 'editor'], ['is_safe' => ['html']]),
new TwigFilter('editor_classes', [$this, 'editorClasses'], ['is_safe' => ['html']]),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better naming suggestions welcome. /cc @luca-rath @thomasduenser @Quehnie @marcostastny @mfehr94 @mscharl @sabinebaer ...

tests/EditorExtensionTest.php Show resolved Hide resolved
docs/editor.md Outdated Show resolved Hide resolved
docs/editor.md Outdated Show resolved Hide resolved
@luca-rath
Copy link
Contributor

@alexander-schranz what do you think of something like symfony's trans_default_domain to set the defaults for editor and editor_classes filters per template? Maybe editor_default_args('div', 'editor') and editor_default_classes({ul: 'list'})?

Copy link
Contributor

@luca-rath luca-rath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@alexander-schranz
Copy link
Member Author

@luca-rath would be interesting but sadly not sure how the trans_default_domain works that it is really context based.

@alexander-schranz alexander-schranz merged commit 1da1e34 into sulu:master Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants