开发者

predefine template for new resource/document

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


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜