为新资源/文档预定义模板
我想将新的子文档设置为默认为与父文档不同的集合模板。
我已经查看了 managermanager,但看起来它无法做到这一点。 mm_inherit只能从父级继承,mm_default不支持模板
I would like to set the new child documents to default to a set template that is different from the parent.
I've looked through managermanager, but looks like it is unable to do this.
mm_inherit can only inherit from a parent and mm_default does not support template
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,所以我最终决定亲自动手并为此编写一些代码。
最初我有点难以置信,这还没有实现。
所以它归结为需要的两件事,一个是插件,另一个是电视。
在电视中,您从数据库中选择所有模板,您可以使用这些模板来设置子文档。然后在插件中使用文档表单预渲染来查看是否设置了子模板 TV,如果设置了则应用它。瞧。
在对插件进行了一些工作之后,我试图让 @SELECT 在电视上工作,我在 modx 论坛上发现了一篇帖子,这让我找到了这个 ->
http://modxcms.com/extras/package/?package=214
所以我最终更换了我的插件,我希望我能早点遇到这个(尽管如此,这仍然是学习的好方法)
ok, so I finally decided to get my hands dirty and put some code together for this.
Initially I had a a bit of disbelief that this wasn't available already.
so it comes down to two things that are required one is a plugin and the other is a TV
In the tv you select all the templates from the database, which you can use to set child documents. Then in the plugin you use the on document form prerender to see if the child template TV is set, and apply it if it is. Voila.
After working on the plugin for a bit, I was trying to get the @SELECT to work for the tv, I came across a post on modx forums, which lead me to this ->
http://modxcms.com/extras/package/?package=214
So I ended up replacing my plugin, I wish I came across this sooner (nevertheless, still good way to learn)