Black Friday sale! Get up to 25% off GP Premium! Learn more ➝

[Resolved] hook element how to invoke visual classic editor

Home Forums Support [Resolved] hook element how to invoke visual classic editor

Home Forums Support hook element how to invoke visual classic editor

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2296409
    John

    I have disabled Gutenberg as the end user (my wife) prefers the classic approach.

    Fair enough, actually I do too.

    I prefer to edit the .css or whatever and certainly don’t appreciate the <!– wp:xxxx –> sprinkled all over the place which bloats the tables (even if stripped out before serving) and makes it difficult to read.

    This can be done (in increasing order of preference) by adding the Classic Editor and Widgets plugins, by the Disable Gutenberg plugin or best simply by adding:

    add_filter('use_block_editor_for_post', '__return_false', 10);

    to the functions.php in the generatepress-child theme.

    This works well, keeps everything neat and tidy and works for posts, pages etc.

    However when I adding a Hook element, it does not display the Visual editor at all, just the plain text editor.

    While I can obviously prepare the text elsewhere, this won’t please the end user!

    So how can I render the Visual Editor visible?

    TIA

    #2296442
    Leo
    Staff
    Customer Support

    Hi John,

    I’ve confirmed with Tom that it’s not possible to use the Visual Editor in a hook element unfortunately.

    Sorry about that!

    #2297054
    John

    The .CodeMirror* class chunk of coding needs to be replaced with something like the #postdivrich id code.

    Can this be enabled in a future release of GP?

    Elements in GP are a useful way of building pages that may have common parts that will save duplication and ensure consistency.

    For the moment I can prepare the code in an invisible new page box and copy the text into an element. 🙂

    #2297591
    Leo
    Staff
    Customer Support

    I believe this is the first that it’s been requested.

    We will definitely consider it if it comes up more.

    Thanks!

    #2298657
    John

    @Leo This only affects those disabling gutenberg so you won’t get many other requests.

    Elements is a useful addition to WordPress so it’s a pity to wait before solving an obvious issue.

    #2298772
    David
    Staff
    Customer Support

    Hi there,

    Most plugins that disable Gutenberg allow you to do so for specific Post types.
    Using one of those methods, you could keep the block editor enabled for the Block Element.
    Within the Block Element you can use a Classic Editor Block.

    Is that a workable option ?

    #2300502
    John

    @David

    It was hook not block element that I wanted to use. The Settings drop down enables hooking the element anywhere in the site.

    The editor issue also occurs for Header/Page Hero.

    For blocks I may as well use the insert pages plugin, which has to be the way forward although I try to keep plugins to the minimum for load time and security reasons.

    I’ve marked the issue as solved anyway!

    #2301694
    David
    Staff
    Customer Support

    The Block Element is virtually the same as the Hook Element.
    The only differences are:

    1. It uses the Block Editor
    2. It won’t allow PHP Editing

    So for HTML, plain text, shortcode or dare i say it block built content, the Block Element can do what you need.

    But i am glad to hear you found a solution.

    #2302978
    John

    @David

    I don’t see any settings tab for Block that enables me to define the hook location.

    I did once generate a block on a different site that also had a hook (ie Block + Hook) but have never managed to repeat this! This was the wpseo-breadcrumb shortcode inserted into every page but editing that element shows no settings on a site that has generateblocks pro as well as the classic editor/widgets – ie gutenberg is not disabled.

    Something is weird.

    #2303039
    David
    Staff
    Customer Support

    If theres nothing messing with the Block Editor then you should see this, after creating a new Block element:

    2022-08-04_11-08-57

    #2303126
    John

    @David

    Selecting the classic editor option in a site with classic editor activated and no disable gutenberg does not make the Block Element with locations visible!

    But selecting block editor does. I added the classic editor later but that explains how I was able to do create the Block + Hook in that site before.

    In a site with gutenberg disables, I tried disabling the disable gutenberg plugin, clearing any caches and creating a Block element.

    This still displays the tinyMCE editor and there is no Block Element in the sidebar.

    As elements are a GP addition, this needs to be addressed. 🙂

    #2303133
    David
    Staff
    Customer Support

    The Block Element will ONLY work as its supposed to if its using the Block editor.
    You can:

    1. Install ( just ) the Classic editor plugin .
    1.1 In the Classic editor settings enable: Allow users to switch editors

    2. Create a new Block Element
    2.1 This will open in the Classic editor, and from the Editor Metabox you can select: Switch to block editor
    2.2 At this point you will now see the screenshot i posted above.

    3. If you want add a Classic Editor Block in the editor.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.