Create custom WP widgets for blocs

Is it possible to develop custom “blocs” or widgets that I can integrate in the builder - specifically I refer to the existing WP widgets available (author name, site name etc etc).

I have a bunch of shortcodes usually that do things I use all the time and I’d like to bring those to blocsapp, so I can just insert a bloc instead of a shortcode or function

For example, a shortcode in WP might be for displaying an image from a custom field or anything else really

Is it somehow possible to create such custom blocs and use them as Integrated parts of blocs app?
So that I could choose them from the WP widgets list for example, when editing in the app.

You can’t at this time, but the answer would be custom brics I think.

the api would need to offer this, but developing custom Wordpress brics for Blocs could be a thing in the future I suppose if Norm chose to go that way.

A Wordpress widget would actually have to exist. The Blocs side of things would just be a way to pull that content into Blocs canvas so you have a nice preview of the widget. That’s it. The content is entered and managed in Wordpress.

1 Like

Right on point, @Whittfield. Besides all that, widgets within WordPress could be going the way of the dodo within a couple of releases.

The WordPress core dev team is currently developing ‘full site editing’ (this article gives quite a good overview on this feature: An Early Look at Full Site Editing in WordPress), which means both the header and footer will also be “built” using the built-in editor. This would also mean: no further pre-designed footers, headers or sidebars, which are also the locations where predefined widget area’s would reside.

It all depends on the support of the theme- and plugin-developers if this feature will gain traction, but I don’t think widgets will still be around in a couple of years.

Thinking of your use case, you could perhaps define multiple widget area’s and use the default HTML-widget to implement your shortcode. But I reckon styling those area’s (and the output of the shortcodes) might prove challenging.

If anything, I think developing your own “blocks” for Gutenberg will be a more interesting route. This way you could develop this once and (via your own plugin) implement this in as much of your sites as you’d like.

2 Likes

Thanks for the tip! I haven’t been so tuned in with Wordpress lately, good to know.

1 Like

Thanks for the feedback.

With “Widgets” I really meant just like any kind of custom PHP code that would, once the theme is active on the site, pull data from the database.
I said “Widgets” because I saw Blocs offering Widgets from WP in the sidebars as “Data source”, but also other WP Data (site name, etc). So I refer to the generic dynamic data to populate a certain bric in Blocs.

For this, I wanted to use not only “inbuilt” widgets and settings, but produce a set of custom options/widgets/brics (not sure how to call this, I think dynamic data for Brics is correct?)
So we could populate a certain bric with data from ShortCode, or literally any PHP function that gets data from the WP Database/API.

The problem with Gutenberg, @brechtryckaert, is that it is not ready for realistic development, neither in the current “page” builder mode nor in the in-dev FSE experience.
Several performance issues, usability issues and a very blurry line drawn in the FSE implementation about who does what and where, unfortunately lead to a solution which may be good for some quick drafts and experiments but not a serious development that is based on sustainability, neither performance (energy) wise nor maintenance wise. At least, not within my experiences. I give it always a new try, and always end up moving away back to good old simple but stable HTML/CSS/JS/PHP.

Too many times I created something in blocks and the next bigger update, because the thing is simply still under development (even if added to core WP) things changed or where lost. That, together with the massive hunger for resources the editor has (Check for example the taxonomy selector in a post editor, compared to pre-gutenberg), has convinced me that I need to wait a few more years to really sell that to clients :slight_smile:

Well, and that is also a reason I am checking out apps like Blocs, which BTW after a night working out on it starts to make me like it.

Now about this thread here, I understand it is not yet possible, but perhaps will in future, which would be of course super cool.

Thanks for all inputs!