Riad Benguella
Forum Replies Created
-
Forum: Plugins
In reply to: [Gutenberg Custom Fields] inability to delete templatesThanks for reporting this issue. GitHub is probably a better place.
This issue is fixed in 1.1.0Forum: Plugins
In reply to: [Gutenberg] Add a HTML block?> Would it be possible, to take the attributes from the blocks, and implement them in the REST API?
This is something we’re considering, we have an open PR for this, but we’re not there yet because this requires server-side parsing which we don’t have yet.
Related material:
– https://github.com/WordPress/gutenberg/pull/2649
– https://github.com/WordPress/gutenberg/issues/2751Forum: Plugins
In reply to: [Gutenberg] Add a HTML block?Hey, thanks for trying to create custom blocks 👍
> But most of the guides are for EXNext, and I can’t make that work
While the gutenberg code is written in ES5, we try to provide documentation in both ESNext and ES5.
In the tutorial here, you can switch between ES5 and ESnext in all the code examples.We also have an examples repository with examples in both https://github.com/WordPress/gutenberg-examples
> As mentioned above, I need to create a custom block that can create
<li>IN the text, like the “Classic text” editorUnfortunately, the “classic text” is not meant to be reusable. We encourage the use of the
Editablecomponent for any block needed html content like the “content” part of your block.
That said, if you want<li>, your options are:– Use multiple
Editablecomponents, one for each<li>(maybe with a button to add rows)
– Use your own custom editor (you can look for any React Wysiwyg component, it should just work)Should we make the “Classic text” editor reusable? I feel like we’re trying to avoid this, but we may reconsider if we see a lot of requests for it.
Does this answer your questions?
- This reply was modified 8 years, 9 months ago by Riad Benguella.
Forum: Plugins
In reply to: [Gutenberg] Add a HTML block?Hi there!
> how do I make the HTML block??
If what you want is adding a rich HTML input (like the paragraph block for example), you’ll have to use the
Editablecomponent. We have some documentation showing how to use this component.– http://gutenberg-devdoc.surge.sh/blocks/introducing-attributes-and-editable-fields/
It might be a good idea to look at examples in our built-in blocks. See here for instance https://github.com/WordPress/gutenberg/blob/master/blocks/library/image/block.js#L244-L252
Forum: Plugins
In reply to: [Gutenberg] Add “ng-href” on a-tags?Hi there!
right now it’s not possible to add
ng-hrefor any custom attribute to blocks, we’re exploring an extensibility API to allow third party developpers to modify exisiting compoenents. For example by addingng-hrefto all links…But in the meantime, can I suggest an alternative for your for you angular theme, wrap your post in a directive and catch all
aclicks inside this directive, prevent default and navigate using Angular APIs instead?Forum: Plugins
In reply to: [Gutenberg] ES5 Source for built-in blocksYou’re welcome 🙂
Forum: Plugins
In reply to: [Gutenberg] ES5 Source for built-in blocksWhilst you’re here, is ESNext with babel etc the recommended way forward? If so perhaps this (and some instructions on setting up) could be included in the docs also.
I don’t think ESNext is the recommended way forward. It is the recommended way for Core development but we do not want to enforce this on theme/plugin authors.
That said, I agree we should add a page in the docs with setup instructions for those who want to use ESNext. The Examples repo serves this purpose too because it has all the setup already in place, but lacks some explanations for now. Raising Docs PRs would be awesome 👍
- This reply was modified 8 years, 10 months ago by Riad Benguella.
Forum: Plugins
In reply to: [Gutenberg] ES5 Source for built-in blocksUnfortunately, we only keep the ESnext version for the built-in blocks. But you can use the InspectorControls similarily to the Block controls http://gutenberg-devdoc.surge.sh/blocks/block-controls-toolbars-and-inspector/
Happy to help if there’s any special use-case you want to write in ES5.
- This reply was modified 8 years, 10 months ago by Riad Benguella.
Forum: Plugins
In reply to: [Gutenberg] ES5 Source for built-in blocksHi, The built-in blocks are built using ESNext code, but there’s the Gutenberg Examples repo showing several blocks in ES5 and ESNext.