Questions tagged [create-guten-block]

26 questions
10
votes
4 answers

React Module parse failed: Unexpected character '@'

I am getting an error when trying to import the following in my react component: import FontIconPicker from '@fonticonpicker/react-fonticonpicker'; import '@fonticonpicker/react-fonticonpicker/dist/fonticonpicker.base-theme.react.css'; I'm using…
CyberJunkie
  • 21,596
  • 59
  • 148
  • 215
5
votes
1 answer

Is there a way to add new tab in WordPress Gutenberg editor

I am completely new to Gutenberg and I need to add a new tab in the setting section Please check this screenshot I Have created some blocks for Gutenberg but no experience in this. I tried this code import { TabPanel } from…
4
votes
2 answers

How to get the site root URL when using Wordpress gutenberg wp object

I just created my first gutenberg block plugin using the npm package create-guten-block. The edit function looks like the code you see below. But it gives a 404 not found on the apiFetch() call because the website lives in a folder, not in the root…
3
votes
1 answer

Run a piece of code when block is loaded in wordpress

I have made a custom gutenberg block: (function(blocks, components, element) { var el = element.createElement; var registerBlockType = blocks.registerBlockType; var TextControl = components.TextControl; …
3
votes
1 answer

Gutenberg RichText cursor focus automatically focus out

I'm trying to enter text via Rich Text by function. but cursor automatically getting outside the RichText. I already import essential component which need on it. I also tried it by onKeyUp instead on onChange but also not working. It's working good…
3
votes
1 answer

How to exclude parent block from innerBlocks?

I want to make a Section block in WordPress Gutenberg. I have created a section block and used Gutenberg component as inner/child blocks. It is working fine but Section block itself showing as its inner blocks list. I want to exclude…
2
votes
1 answer

"No block type exists" when trying to create ACF block for Gutenberg

I have a new block that I'm trying to init which is called hero. At the moment, I'm trying to assign an ACF field group to that block, but currently seeing this in the WordPress backend: I have created the block and registered the block type, but…
2
votes
0 answers

Image not being output in a Gutenberg custom block

A bit new to Gutenberg, and for the past 10 hours I've been trying to allow background image uploads for a nested block as per this guide: https://www.liip.ch/en/blog/add-an-image-selector-to-a-gutenberg-block It works just fine in the backend, but…
2
votes
0 answers

How to add wysiwyg editor in custom generated gutenberg block in wordpress

Is there any way to add WYSIWYG Editor in a custom generated Gutenberg block in WordPress. I had searched in google and only found how to add Richtext editor to the custom block. What i need is a complete WYSIWYG editor like below.
2
votes
0 answers

Moving Excerpt from Admin Sidebar below Post Title

I would like to remove edit excerpt section from the admin's right sidebar and move to the main editing block below the post title and above the Gutenberg blocks. Is there any option to add code to functions.php? I only found old code for pre…
2
votes
0 answers

editor.BlockListBlock Filter not passing BlockListBlock to Function

When I have define( 'SCRIPT_DEBUG', true ); In my wp-config.php, I receive the correct object from calling this hook: editor.BlockListBlock. When I have define( 'SCRIPT_DEBUG', false ); or not defined, I receive the wrong object. const {…
2
votes
1 answer

Dynamic Block - How to create dynamic stylesheet on post save / load

I've created a working Gutenberg Block with Create Guten Block (https://github.com/ahmadawais/create-guten-block). Currently it's only working with inline-styles, but as a requirement I have to avoid them. Therefore I want to create a post/page…
Alex Berger
  • 1,357
  • 1
  • 10
  • 22
2
votes
2 answers

WP Page Template with pre-defined Gutenberg Blocks

For one of my project I'm trying to use pre-defined Gutenberg blocks on custom page template. I' using Block Lab WP Plugin to create custom Gutenberg blocks. But when I used on page template, that doesn't work. Is it possible to use Gutenberg blocks…
1
vote
0 answers

How to make a Gutenberg block with nested html elements?

I am working on a custom Gutenberg block for a website. As you can see in the picture, the card element has a button with dual coloured text. The html of the same looks like Start now $209/mo I used RichText component…
1
vote
1 answer

Gutenberg custom block how to send data from plugin index file to js file

I have registered custom block in plugin main/index php file. register_block_type('gutenberg-custom/show-information', array( 'editor_script' => 'gutenberg-show-information', 'style' => 'gutenberg-customblock-css', )); I want to…
1
2