• Resolved hex6

    (@hex6)


    Hello, and thanks for this great plugin! I like Bootstrap columns more than default ones and your plugin makes it possible to use them really easy.
    As a theme, I use WP Bootstrap Starter + Child and I wanted to add custom bg-colors for columns, so I followed your instructions:
    1) I added block-filter.js:

    function myColumnBgColorOptions( bgColorOptions ) {
        bgColorOptions.push(
    	{name:'primary', color:'#031251'},
    	{name:'secondary', color:'#245011'},
    	{name:'primary-light', color:'#7288d2'},
    	{name:'secondary-light', color:'#8db351'},
    	{name:'dark', color:'#1e1e1c'},
    	{name:'light', color:'#ececec'});
        return bgColorOptions;
    }
    wp.hooks.addFilter( 'wpBootstrapBlocks.column.bgColorOptions', 'myplugin/wp-bootstrap-blocks/column/bgColorOptions', myColumnBgColorOptions ); 

    2) added it from functions.php as you described here https://www.ads-software.com/support/topic/custom-row-types/

    3) now I can see new color circles in editor-panel, but if I choose one it doesn’t affect column in editor mode (unlike your preset primary and secondary colors which applies to columns even in editor-mode).

    4) out of editor-mode colors shows nicely as expected.

    Is it possible to make colors work in editor-mode?
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor tschortsch

    (@tschortsch)

    Hi @hex6. You’re right. This is only implemented for the built-in background-colors (primary, secondary) right now. I’ll try to fix that in the next release.

    Thread Starter hex6

    (@hex6)

    Oh, thanks! So sad (in this particular case) I’m not a frontend developer and can’t help you.
    That also would be nice if the colors with the same name will override existing (primary, secondary, etc.) because I think most people use the custom color palette for these names for their sites anyway.
    Thanks for this plugin again!

    Plugin Contributor tschortsch

    (@tschortsch)

    You should already be able to do that by overwriting the whole bgColorOptions array like this:

    function myColumnBgColorOptions( bgColorOptions ) {
        return [
    	{name:'primary', color:'#031251'},
    	{name:'secondary', color:'#245011'},
    	{name:'primary-light', color:'#7288d2'},
    	{name:'secondary-light', color:'#8db351'},
    	{name:'dark', color:'#1e1e1c'},
    	{name:'light', color:'#ececec'},
        ];
    }
    Thread Starter hex6

    (@hex6)

    Thanks!

    Plugin Contributor tschortsch

    (@tschortsch)

    Just released v2.3.0 of the plugin (https://github.com/liip/bootstrap-blocks-wordpress-plugin/releases/tag/2.3.0) which now also shows custom background colors in the editor. Hope this helps!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘BG colors don’t show in editor mode’ is closed to new replies.