admin管理员组文章数量:1122832
I am looking for a way for users (who will be site admins) to design Blocks that will be used by a plugin I am developing. I want the solution to work in both Classic and Block themes, so I have been exploring the support for Template Part Blocks in Classic themes.
This is working, and when I go to Appearance / Template Parts, the existing Template Parts I have defined can be edited. However there is no option to add a new Template Part. It appears that the only way to add one is to put a .html file into the file system. Note that at present I am adding these files to my Theme folder, but I have found a solution that will allow them to be added to my Plugin folder, I just haven't implemented this yet.
Is there a way to allow users to create new Template Parts in Classic Themes without creating a file manually?
I have considered providing an option on one of my admin screens to create a new file for the Template Part, which the user could then update with the editor, but I am concerned that these files would be lost when the plugin is updated.
I am looking for a way for users (who will be site admins) to design Blocks that will be used by a plugin I am developing. I want the solution to work in both Classic and Block themes, so I have been exploring the support for Template Part Blocks in Classic themes.
This is working, and when I go to Appearance / Template Parts, the existing Template Parts I have defined can be edited. However there is no option to add a new Template Part. It appears that the only way to add one is to put a .html file into the file system. Note that at present I am adding these files to my Theme folder, but I have found a solution that will allow them to be added to my Plugin folder, I just haven't implemented this yet.
Is there a way to allow users to create new Template Parts in Classic Themes without creating a file manually?
I have considered providing an option on one of my admin screens to create a new file for the Template Part, which the user could then update with the editor, but I am concerned that these files would be lost when the plugin is updated.
Share Improve this question asked Jul 9, 2024 at 21:09 zcesl53zcesl53 354 bronze badges1 Answer
Reset to default 1According to Carolina's excellent reference on full site editing, hybrid themes (that use both PHP and block template parts) can only allow users to add new template parts if you activate the Gutenberg plugin.
本文标签: Adding new Template Parts in the Block Editor when using Classic Themes
版权声明:本文标题:Adding new Template Parts in the Block Editor when using Classic Themes 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301382a1931159.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论