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

Why does the pattern editing on "Edit Page" changes? #67600

Open
slideandscroll opened this issue Dec 4, 2024 · 2 comments
Open

Why does the pattern editing on "Edit Page" changes? #67600

slideandscroll opened this issue Dec 4, 2024 · 2 comments
Labels
[Type] Enhancement A suggestion for improvement.

Comments

@slideandscroll
Copy link

I don´t understand why I have to click "Edit" in pattern popup menu to edit a pattern on "Page Edit" and not as expected in Gutenberg editor?

Image

And the "Classic" editor opens and looks like this...

Image

I mean this is far away from usability! Is there an way to change this by settings?

I use the latest WordPress version.

Regards

@slideandscroll slideandscroll added the [Type] Enhancement A suggestion for improvement. label Dec 4, 2024
@carolinan
Copy link
Contributor

carolinan commented Dec 5, 2024

Hi @slideandscroll

From the screenshot, it looks like you are editing a classic block, and not a pattern?

The reason why the classic editor opens in a modal is technical. The block editor uses an iframe. The classic editor block does not work in this iframe, and needs to be opened outside it.

Can you share the steps you took to get this result? With the help of more detailed instructions, other contributors can try to reproduce it.

There may be a conflict between the classic block and your theme or a plugin. When I test the classic block with the themes Twenty Twenty-One and Twenty Twenty-Five, I do not see these broken toolbars with the miss-placed buttons.
Please test again with all plugins deactivated and a default WordPress theme.

@slideandscroll
Copy link
Author

slideandscroll commented Dec 6, 2024

Hi @carolinan,

sorry for my late response. Well, it is a theme I developed for my customer who struggles with the usability of Gutenberg editor. I coded some pattern from the scratch but not way of WordPress - less control about the code and this code (generated) is horrible to understand.
Anyway... Yes, you are right! When you add "my" patterns to a page, WordPress or Gutenberg editor converts the pattern code into a classic block. That´s okay and you can edit "my" patterns in the classic editor. My customer is satisfied.
I also customized the classic editor toolbar by code.

// Adds buttons to the TinyMCE editor toolbar (first row).
function buttons_to_tinymce_toolbar_first_row($buttons) {
    return array(
        'formatselect',
        '|',
        'fontselect',
        'fontsizeselect',
        'bold',
        'italic',
        '|',
        'underline',
        'strikethrough',
        'subscript',
        'superscript',
        'charmap',
        '|',
        'indent',
        'outdent',
        '|',
        'alignleft',
        'aligncenter',
        'alignright',
        'alignjustify',
        '|',
        'wp_adv'
    );
}

add_filter('mce_buttons', 'add_buttons_to_tinymce_toolbar_first_row');

// Adds buttons to the TinyMCE editor toolbar (second row).
function add_buttons_to_tinymce_toolbar_second_row($buttons) {
    return array(
        'forecolor',
        'backcolor',
        '|',
        'bullist',
        'numlist',
        '|',
        'link',
        'unlink',
        '|',
        'blockquote',
        'wp_add_media',
        'table',
        '|',
        'removeformat',
        'undo',
        'redo',
        '|',
        'pastetext'
    );
}

add_filter('mce_buttons_2', 'add_buttons_to_tinymce_toolbar_second_row');

The problem is after the update to WP 6.7.x you need to edit classic block in this modals and not more in the page directly and shows this behavior of the classic editor.
I downgraded WordPress to 6.6.2 and it works well again (see below).

Image

May you add a setting to the page preferences that you can switch between classic block editing on the page or on the modal? Or is there already a setting possibility?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants