Forum Replies Created
-
AuthorPosts
-
Jackky
ParticipantJust noticed the same
Jackky
ParticipantYes, but regex must render "as is" inside the pattern attribute
Jackky
ParticipantOk, forum collapse entities also they are inside backticks... Here a pastebin, where converted entities are shown.
Jackky
ParticipantShould notice: it's the latest version of MetaBox it self (5.7.4) and Conditional Logic plugin (1.6.19)
December 12, 2021 at 5:22 AM in reply to: ✅A block without fields does not show the content in Gutenberg #32543Jackky
Participant+1.
My temporary solution is to use fake field with type "hidden", like this[ 'id' => 'preview_hack', 'type' => 'hidden', 'std' => '1', ]Jackky
ParticipantBut how it is organized in the native clonable sequense, like columns, for example? Is there a way to solve this?
Jackky
ParticipantTrying to insert 2 different <InnerBloks /> tags causes the same weird result
August 19, 2021 at 2:24 AM in reply to: Add wp.hooks.addFilter support for registerBlockType in metabox #30331Jackky
ParticipantI'm totally upvoting for this feature too
Jackky
ParticipantI think you should make some filters for default settings of tinyMCE. Like as for me: I'm using in most cases very "tinyfied" tinyMCE editor and for cases like this I'm writing some simple helper functions, like 'mb_tinymce_defaults( $extend = false )', that is returns an array of defaults, merged with $extend array if it set
Jackky
ParticipantHi! I have made a temporary solution for this purpose: https://support.metabox.io/topic/strange-wysiwyg-behavior-inside-group/#post-27514
Jackky
ParticipantHi again!
Guys, I'm very-very (really a lot) upset about so log time to find a solution for this. About a year passed, but you didn't make a fix of this issue. I'm really wondering why, because it feels, like you have very low priority to modify and update mb-blocks extension, despite the fact that, in theory, it should be one of the main extension in your bundle stack. I'm really willing you will change your mind about making mb-blocks the most modern and powerful solution of easy-block-building-api's, because such expectations from the product prompted me to buy lifetime developer bundle. Please do not disappoint me and my fellow developers.
As I need ability to customize tinymce editor a lot, yesterday I decide to dive into this problem, trying to figure out where the problem is. I have spend several hours, and finally made a new field, based on default 'wysiwyg' field with some custom improvements and changes. The result works perfect for me and solving all my problems and tasks about that. I really hope that you will review my solution of the problem and fix it in the plugin itself.
NOTE: The code is bad, not refactored and not tested for whole cases, but it worksHere my solution:
You should enqueue modified wysiwyg.js script to the admin area, like as separate file either an inline code. NOTE: the 'rwmb' script dependency handle is required
Here's the js code: https://pastebin.com/kJkCazm5Next you should register a new extended rwmb field type, that based on default wysiwyg.php class. Just paste the code below into your functions.php theme file, or include it in some other way:
https://pastebin.com/D5R7y0zqNow you are able to create a new type of field - 'jackky-tinymce', below is my test example (sorry for some weird russian words :)):
[ 'id' => 'text', 'type' => 'jackky-tinymce', 'name' => 'Jackky TinyMCE', 'settings' => [ // NOTE: I replaced the 'options' key with the 'settings' key, that contains 2 child keys: 'tinymce', that contains an array of tinymce settings, and 'quicktags' if you need to modify the the textmode tag buttons 'tinymce' => [ 'media_buttons' => false, 'drag_drop_upload' => false, 'content_css' => get_template_directory_uri() . '/assets/css/tinymce.min.css', // you can load your custom css file to style the tinymce content like on frontend 'toolbar1' => 'styleselect,bold,italic,bullist,numlist,link,unlink,fullscreen', // set different tinymce settings as usual, like a toolbars buttons 'toolbar2' => 'alignleft,aligncenter,alignright,undo,redo', 'style_formats' => [ // define any nested settings as arrays, like 'style_formats' example [ 'title' => 'Имитация strong', 'inline' => 'span', 'classes' => 'strong' ], [ 'title' => 'Имитация italic', 'inline' => 'span', 'classes' => 'em' ], [ 'title' => 'Тонкий', 'inline' => 'span', 'classes' => 'b300' ], [ 'title' => 'Полу-жирный', 'inline' => 'span', 'classes' => 'b500' ], [ 'title' => 'Экстра-жирный', 'inline' => 'span', 'classes' => 'b900' ], [ 'title' => 'Имитация h1', 'block' => 'div', 'classes' => 'h1' ], [ 'title' => 'Имитация h2', 'block' => 'div', 'classes' => 'h2' ], [ 'title' => 'Имитация h3', 'block' => 'div', 'classes' => 'h3' ], ], ], 'quicktags' => [ 'buttons' => 'strong,em,u,link,ul,ol,li' ] ], ]The result of all of this stuff
With a 'side' context of metabox:

With a standart context:

Also you should add some css to your admin, if you make this field clonable:
.rwmb-jackky-tinymce-clone { padding-top: 20px; }Thats all. Feel free to use my solution.
April 22, 2021 at 2:48 PM in reply to: ✅How can I use the custom asset callback to render a block properly? #27501Jackky
ParticipantHi! I think you no need this. I'm acieving the same (working custom js on backend, like on frontend), by calling my libs.js and main.js files (custom ones) within a 'enqueue_block_editor_assets' action. And in main.js I have the stucture like this:
( function( $ ) { window.initScripts = function() { // HERE ALL CONCATENATED CUSTOM JS } if ( $('#editor').length ) { $( document ).on( 'mb_blocks_preview', initScripts ) //call scope on 'mb_blocks_preview' event in gutenberg } else { $( initScripts ) // frontend call e.g. $(document).ready() } })(jQuery)This solution works excellent with any custom js. For example I'm using Swiper in all my projects too and it works perfectly on frontend either in the backend and without the need to make any 'special' js-file for gutenberg previews.
Jackky
ParticipantAnd my vote for this too
Jackky
ParticipantOh...( Really? No any hacky way to do this? There is no public filters etc. on block save\update? Seriously? Need this a lot. Also MetaBox is positioning itself as a great framework-like tool for programmers, not a wysiwyg-like solution for no-code experience. And I (I think, I'm not alone in this thought) expect to have all the necessary filters\hooks for my development with this solution. Otherwise, one day, unfortunately, I will have to stop using the MetaBox and switch to using native block-building practicies or some advanced solutions. Because things like this is really important.
Jackky
ParticipantThank you! Updating helps!
-
AuthorPosts