8000 Add EditorExtension by alexander-schranz · Pull Request #21 · sulu/web-twig · GitHub
[go: up one dir, main page]

Skip to content

Add EditorExtension #21

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

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 alexander-schranz self-assigned this Jan 11, 2020
@alexander-schranz alexander-schranz force-pushed the feature/editor-twig-extension branch 3 times, most recently from 408eec8 to 73f60ad Compare January 11, 2020 16:22
@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 ...

@alexander-schranz alexander-schranz force-pushed the feature/editor-twig-extension branch from 73f60ad to de68e12 Compare January 12, 2020 03:31
@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 a 8000 nd 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 force-pushed the feature/editor-twig-extension branch from e6d4655 to 619b1a7 Compare January 13, 2020 13:29
@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.

2 participants
0