简体   繁体   English

古腾堡块和页面模板

[英]Gutenberg blocks and page templates

I developed a pretty complex site with many different page templates, where I echo a lot of custom post-type content, as well as ACF flexible content.我开发了一个非常复杂的网站,其中包含许多不同的页面模板,其中我回应了许多自定义帖子类型的内容,以及 ACF 灵活的内容。 Now I would like to create some custom Gutenberg blocks for the site, but I'm not sure how it would fit in with the code I already have in the page templates.现在我想为网站创建一些自定义的 Gutenberg 块,但我不确定它如何适应我在页面模板中已有的代码。 As an example, I would like to create a graph using Gutenberg blocks, that would display after an events section that I'm echoing out in the page template.例如,我想使用 Gutenberg 块创建一个图表,该图表将显示在我在页面模板中回显的事件部分之后。

I'm not sure how that would work.我不确定那将如何工作。 Should I create a Gutenberg block for the custom post type?我应该为自定义帖子类型创建一个古腾堡块吗? Does anyone have any experience with mixing things like flexible content and Gutenberg?有没有人有混合灵活内容和古腾堡之类的经验? Is it worth using Gutenberg on this site?是否值得在此站点上使用古腾堡?

Gutenberg receives another update with version 12.7. Gutenberg 收到另一个版本 12.7 的更新。 With peeled eyes, especially after the launch of WordPress version 5.9 with much-awaited full-site editing, block themes, and much more.睁大眼睛,尤其是在 WordPress 版本 5.9 发布之后,具有期待已久的全站编辑、块主题等功能。

Gutenberg 12.7 offers intuitive and necessary enhancements that will make working with patterns even easier. Gutenberg 12.7 提供了直观且必要的增强功能,使使用模式变得更加容易。 Let's see what version 12.7 of Gutenberg holds for us.让我们看看 Gutenberg 的 12.7 版本对我们有什么帮助。

The list view keeps getting interesting updates.列表视图不断获得有趣的更新。 Now there is an option to select multiple blocks.现在可以选择 select 多个块。 You can do this by holding the shift key and clicking on multiple blocks to select them.您可以通过按住 shift 键并单击多个块来实现此目的 select 它们。 One can also use the up and down arrows ↕️ to select multiple blocks.也可以使用上下箭头↕️到select多个块。

All this goes on to increase the block editor experience, and provide a more effective way to drag and drop blocks, change multiple blocks into a group or a list, etc.所有这一切都增加了块编辑器的体验,并提供了一种更有效的方法来拖放块、将多个块更改为一个组或一个列表等。

Gutenberg version 12.6 got improved and enhanced block transform features. Gutenberg 版本 12.6 得到了改进和增强的块转换功能。 This includes maintaining font size and color while selecting between different blocks like list, quote, etc.这包括在列表、引用等不同块之间进行选择时保持字体大小和颜色。

Gutenberg 12.7 adds custom CSS classes to this, allowing you to maintain custom block styles.古腾堡 12.7 添加了自定义 CSS 类,允许您维护自定义块 styles。

A article from WPWhiteBoard might help you in this. WPWhiteBoard的一篇文章可能会在这方面对您有所帮助。 Have a look.看一看。 If it not helps you, do reply in this thread.如果对您没有帮助,请在本帖中回复。 I will try my best to resolve your query.我会尽力解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM