我建议您阅读 https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727;它将回答您的问题!
本质上,插件出口是一种在特定位置注入代码的方式。
建议使用 theme CLI 创建一个主题组件,并使用 单独的文件,就像我在我的主题组件中所做的那样(请随时克隆我的存储库以便您可以测试/修改它):
但是,您仍然可以从您的 <script> 标签进行测试:
在您的情况下,您将编写:
<script type='text/x-handlebars' data-template-name='/connectors/user-profile-controls/my_connector_name'>
Template content here
</script>
请注意第一行。我们将 user-profile-controls 用作连接器名称,而 my_connector_name 可以是您想要的任何名称。