Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Phi Phan

    (@mr2p)

    Thank you for your feedback. This will be included in my to-do list next version.

    Thread Starter chenz2

    (@chenz2)

    I should clarify. Your programs blocks do show up in the block inserter toolbox on the left (with block manager published), when you edit a page in WordPress. But they don’t show up in block manager anywhere, so I can’t change what block category they go in. Is there a manual way currently for me to move them to a certain block category? Like maybe some function code I can put in? This would be super helpful in the meantime.

    Plugin Author Phi Phan

    (@mr2p)

    I’ve just deployed the fix for compatibility with the Block Manager plugin. The new blocks will be shown on Block Manager. I didn’t include a migration for the old blocks so please create new ones for now.

    Thread Starter chenz2

    (@chenz2)

    Thanks! I do see them now.

    Something must have changed though with the naming of the custom blocks. For instance, I use this code to make blocks a default size:

    // Default to Full
        //   Existing Group that isn't Full will have "invalid content" error.
        //   Clicking "Attempt Block Recovery" will fix it, but it becomes Full.
        case 'core/group':
        case 'core/cover':
        case 'boldblocks/new-custom-block':
          return lodash.assign( {}, settings, {
            attributes: lodash.assign( {}, settings.attributes, { align: {
              type: 'string', default: 'full'
            } } ),
          } );

    Now case ‘boldblocks/new-custom-block’ doesn’t work even though the name of the block is still new-custom-block. Did something change there?

    Also, can you add Block Variations to block manager too? I might be stuck using those more based on how custom blocks are hard to delete.

    I appreciate your willingness to look at all this! Loving this program.

    • This reply was modified 3 years, 1 month ago by chenz2.
    Plugin Author Phi Phan

    (@mr2p)

    Yes, I did some “quite big” changes for registering the blocks. In the first release, I registered the blocks too late, that’s why the block manager plugins could not see the custom blocks. I’ve changed the way of registering the blocks in the latest release, the old blocks were missing some metadata that why they could not be loaded in the 1.0.1 version. Because it’s early and not many sites used it, I don’t have time to do a migration task for old blocks, so, please re-create your blocks this time. Thank you.
    Regarding the variations, I’m not sure the block manager plugin supports variations. I’ll look into it soon later.

    Edited: You can update metadata for old blocks by changing the content and do an update. That makes old blocks can be loaded in the 1.0.1 version

    • This reply was modified 3 years, 1 month ago by Phi Phan.
    • This reply was modified 3 years, 1 month ago by Phi Phan.
    Thread Starter chenz2

    (@chenz2)

    Yes I am aware old blocks cannot be loaded. That is totally fine and workable at this stage. I did that and the block does show in block manager. But what is the new way of naming a custom block? It used to be this, if the custom block name was new-custom block: boldblocks/new-custom-block

    What would it be now, so I can set default values for it.

    • This reply was modified 3 years, 1 month ago by chenz2.
    Plugin Author Phi Phan

    (@mr2p)

    There is no new rule for naming custom blocks. The name of custom blocks is the post_name field for the ‘Custom Blocks’ post with the prefix boldblocks/.

    Thread Starter chenz2

    (@chenz2)

    Something must have changed between 1.0 to 1.01 that controls whether defaults work or not, since this javascript code below no longer works to assign defaults to these custom blocks.

    So you can see below, the custom block I made with your program is listed. When I added it to a page before, the default alignment was set to full. This made it span the full width of page by default. Now however, when I insert your custom block, the default for align is just normal. It’s ignoring that I have it set to FULL. It was working in 1.0 but not anymore.

    Thoughts?

    // Default to Full
        //   Existing Group that isn't Full will have "invalid content" error.
        //   Clicking "Attempt Block Recovery" will fix it, but it becomes Full.
        case 'core/group':
        case 'core/cover':
        case 'boldblocks/new-custom-block':
          return lodash.assign( {}, settings, {
            attributes: lodash.assign( {}, settings.attributes, { align: {
              type: 'string', default: 'full'
            } } ),
          } );
    • This reply was modified 3 years, 1 month ago by chenz2.
    Plugin Author Phi Phan

    (@mr2p)

    Please double check your block’s name. Each block has a unique name, so your code only works with the block with named boldblocks\new-custom-block. You can name your blocks to anything when creating them. All custom blocks will be prefixed as boldblocks/and follows by the post_name field so you can filter them all by that prefix.

    Thread Starter chenz2

    (@chenz2)

    I placed this JS code in a different location and now it seems to work. Maybe the order things are processed in affect things. Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Block Manager Compatibility’ is closed to new replies.