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

Attaching Page Builder to a custom WYSIWYG #90

Open
richardtape opened this issue Aug 13, 2015 · 3 comments
Open

Attaching Page Builder to a custom WYSIWYG #90

richardtape opened this issue Aug 13, 2015 · 3 comments

Comments

@richardtape
Copy link

Hey folks,

I have a custom post type which - intentionally - doesn't support the standard WordPress editor. Instead, using CMB2, I have a custom WYSIWYG field (let's start with just one for now). The WYSIWYG field is implemented in 'the WordPress way' (as you would expect, CMB2 is dev'd by some top, top folk).

I'm trying to work out if there is a simple way (or if not simple, any way at all) to attach the Page Builder to a custom WYSIWYG field, rather than the standard WordPress editor.

I can see the builderView().attach() and builderView().attachToEditor() methods in the JS, but don't quite see how to manually say, "hey, attach yourself to THIS editor, not the 'normal' one"

Any tips?

I think the big concern is that in the attachToEditor() method it looks specifically for $( '#wp-content-wrap .wp-editor-tabs' ) which, when a post type doesn't support the native WordPress editor, doesn't exist.

(Note: I opened a thread on your support forums, but then I couldn't post a follow-up comment as it white-screened and I couldn't close the ticket. I thought it was best to report this as an actual issue as I discovered more after the initial forum post)

@gregpriday
Copy link
Member

Hi there @richardtape

Right now, I think the only way to really support this would be for CMB2 to specifically add a Page Builder field that integrates with Page Builder.

Attaching a Builder view to a TinyMCE field isn't that difficult (assuming CMB2 uses TinyMCE for it's WYSIWYG fields), but the problem is that this field will need to specifically look for the panels_data array and process that. So there's a little more to it.

CMB2 do list 3rd party fields, so I'm guessing it would be possible to add a Page Builder field. Right now my schedule is a little tight, but if I get a chance in the future I'll look at adding this to Page Builder. Either in the core or as a separate plugin.

@richardtape
Copy link
Author

Hey @gregpriday thanks so much for the reply. Honestly, I'd much rather you spend some time on perhaps writing some basic docs on how this could be implemented. I'm happy to create the CMB2 add-on once I get the general gist. Does that sound like something you could do? Perhaps throw up a quick gist on the basics of doing it, I'll even be happy to flesh it out once I get my head around it?

@mikecronin85
Copy link

Any progress on this issue? We have a site that utilizes CMB2 WYSIWYG fields that we would love to attach a Page builder to. Haven't found much luck Google searching, but if there is an update anyone has found please share!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants