Daniel Richards
Forum Replies Created
-
Forum: Plugins
In reply to: [Gutenberg] how to create an ‘entry template’ with re-usable blocksHi @sacdawg, as mentioned, block templates are the feature that allows you to insert a predefined set of blocks into a post upon creation. There’s some details about that here:
Gutenberg Handbook | Block TemplatesIt’s quite code-centric unfortunately, and requires the knowledge of, or ability to find out what a particular block’s attributes are.
- This reply was modified 7 years, 3 months ago by Daniel Richards.
Hi @sequestersol, from the screenshot it looks like the editor is in ‘code editor’ mode. If you use the editor settings menu in the top-right corner (it looks like three dots stacked), could you check whether there’s a ‘visual editor’ option? If there is, selecting it should take you back into the normal editing mode.
It’s also possible that your user profile has the visual editor disabled. In the edit profile screen there’s a checkbox for ‘Disable the visual editor when writing’, that should be unchecked.
Forum: Plugins
In reply to: [Gutenberg] Container BlockHi @vitamincee, there is a new Group Block in the Gutenberg plugin, but unfortunately it wasn’t released in WordPress 5.2. Development wasn’t quite completed in time for it to be included in 5.2.
My understanding is that it should be in the 5.3 release.
Forum: Plugins
In reply to: [Gutenberg] gutenberg media and text blockIt does seem to work inside a column as well.
Here’s what I did:
1. Add a columns block by typing
/columnsinside a new block and hitting enter.
2. Add an image block by typing/imageand hitting enter.
3. Add some text in a paragraph block after the image block (this can be a bit tricky, but there should be a plus button just under the image block if you move your mouse, or you can use the down arrow key a couple of times).
3. Select an image from my media library in the image block
4. Made the image smaller so that text can sit alongside it.
5. From the block toolbar, aligned the image to the left.After doing this I had an image inside a column aligned to the left of the column, and text to the right of the image.
Forum: Plugins
In reply to: [Gutenberg] Sometimes when you press enter the block will be duplicatedHi @ramonjosegn,
I haven’t come across this issue, but if you’re able to work out how to reproduce the problem consistently and share the steps then we can make sure there’s a bug report on the Gutenberg github project. That would be an amazing help.
Thanks.
Forum: Plugins
In reply to: [Gutenberg] gutenberg media and text blockHi @loosefast. You should be able to use a normal image block. Upload the image, and then from the block toolbar there’s an option to align the block left or right. You can then change the size of the image to make sure there’s space for text to flow around it. You’ll probably also need to add the image block before the text.
Forum: Plugins
In reply to: [Gutenberg] Accordion Blocks with LinksHi @carbow – the accordion isn’t one of the default blocks. Are you using a plugin to add the accordion block to your editor? If so, I’d recommend making a post on the support forum for that plugin.
Forum: Plugins
In reply to: [Gutenberg] Yoast SEO options hovering above postHi @twellibaum,
Would you be able to share a screenshot? You won’t be able to upload directly to the forum, but if you’re able to use a third-party service or your media library to host the image and share a link, that’d be really useful.
Thanks.
Forum: Fixing WordPress
In reply to: Default end-of-post text in Gutenberg (how?)> Where did you find the API details?
My example was lifted pretty gratuitously from the one in the handbook:
https://wordpress.org/gutenberg/handbook/designers-developers/developers/block-api/block-templates/
For finding the block attributes I had to look through the Gutenberg codebase.
The block-library folder contains each of the blocks. Under the subfolders for each block there’s an index.js file that contains the specification for each block, part of that is the attributes object (sometimes also called schema). Some examples:
– https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/paragraph/index.js#L34-L73
– https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/quote/index.js#L20-L40
– https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/more/index.js#L41-L49There is an issue that tracks adding documentation for blocks, so hopefully that will be resolved at some point in the near future and it’ll make this easier:
https://github.com/WordPress/gutenberg/issues/6190- This reply was modified 7 years, 7 months ago by Daniel Richards.
- This reply was modified 7 years, 7 months ago by Daniel Richards.
Forum: Plugins
In reply to: [Gutenberg] This block has encountered an error and cannot be previewedHi @loosefast,
The issue sounds very similar to this one created on the github repo for Gutenberg:
https://github.com/WordPress/gutenberg/issues/8099That seems to suggest that more recent versions of WordPress don’t have the same issue, I’m not sure if you’ve already updated or not. It also mentions wp-tinymce.php is the only file Gutenberg requires, so that might help.
It could also be worth reaching out to the plugin authors to see if they have any suggestions. Is this the same plugin you’re using?
https://wordpress.org/support/plugin/sucuri-scannerHi,
The issue sounds similar to the one reported in this thread:
https://wordpress.org/support/topic/visual-and-block-editor-are-gone/The solution in that case was to go to ‘Edit my profile’ in the top right corner and deselect the ‘Disable the visual editor when writing’ option.
Let us know how you get on 🙂
Forum: Fixing WordPress
In reply to: image upload failure@bvo – what kind of a setup/server do you use? I know there are reports of an issue with IIS servers and media uploads, though the error sounds different to the one you’re seeing. You could also try uploading first to the media library outside of Gutenberg as an intermediate workaround, maybe that will work.
Forum: Requests and Feedback
In reply to: What’s the Roadmap? (Gutenberg / Node.js)> Can you tell me more on what’s the roadmap?
I only know what’s available in public channels, you’ve probably read it already:
> I’ve read up next there’s the widget area going to be removed
That’s not my interpretation. There is a plan to introduce blocks in the widget area—that makes sense to me, blocks are not dissimilar to the concept of widgets, but will eventually be useable in a wider range of contexts. I’m sure it’ll be an evolution, but there are some concepts shared publicly:
Forum: Fixing WordPress
In reply to: Default end-of-post text in Gutenberg (how?)There is another way to do this, which is probably the right way for blocks. Gutenberg has a concept of block templates. More about that here:
https://wordpress.org/gutenberg/handbook/designers-developers/developers/block-api/block-templates/You can assign a template to be the default for a particular post type, specifying the blocks you want within that template. The tricky bit is that you need to figure out what the attributes are for the blocks. Here’s what I attempted for your content (this should replace your existing function):
function my_add_template_to_posts() { $post_type_object = get_post_type_object( 'post' ); $post_type_object->template = array( array( 'core/quote', array( 'value' => '<p>...summary goes here</p>', ), ), array( 'core/more', ), array( 'core/paragraph', array( 'content' => '...content goes here', ), ), array( 'core/paragraph', array( 'className' => 'copyr', 'content' => '…Copyright notice, etc…', ), ), ); } add_action( 'init', 'my_add_template_to_posts' );When I tried this, it seemed to work correctly and the class name was preserved.
- This reply was modified 7 years, 7 months ago by Daniel Richards.
- This reply was modified 7 years, 7 months ago by Daniel Richards.
Forum: Requests and Feedback
In reply to: What’s the Roadmap? (Gutenberg / Node.js)Hi @bortran – I can’t answer in any official capacity, I’m a dev and I haven’t been involved in any of those decisions, but I have been working on Gutenberg over the last few months.
From what I’ve seen, node.js is only being used to provide tooling for client-side code. The runtime for node is used for things like building, running tests and linting. Then there’s NPM which is used to manage code dependencies for JavaScript in a similar way to composer in PHP. I’m not aware of instances where node is being used as a server, but I could be wrong.
Gutenberg does embrace a lot of current JavaScript and functional programming practices for client-side development. Having said that it also depends on existing PHP code, in particular in the form of the REST API, the bootstrapping for the editor, and some of the new APIs (like dynamic blocks), so I can’t see PHP going away.
If I had to guess, your current skills will, in my opinion, continue to be strongly valued, but if I were in your shoes it could be worth looking at picking up some JavaScript/React/Redux knowledge. The next few phases of Gutenberg will definitely see that part of the codebase growing and touching more parts of the WP experience.
- This reply was modified 7 years, 8 months ago by Daniel Richards.