English 中文(简体)
predefine template for new resource/document
原标题:
  • 时间:2010-03-05 22:39:56
  •  标签:
  • modx

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)

问题回答

暂无回答




相关问题
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 ...

Modx css issue not pulling in styles on the form

I m editing a site using Modx cms. I m trying to add a contact form to the contact page. I already have one in the sidebar specified in a template. The code on the contact page form points to the same ...

PHP MODx mysql Parse error? Where do I change the settings?

Hi I m using MODx on a site, but something has gone wrong with the database. Any idea how I can change the PHP to point to my database? « MODx Parse Error » MODx encountered the following error while ...

Print a table in modx to send info for mail by eForm

My question is, how can I create a table with dynamic fields (I will explain this later), and send them values by mail with eform? In the table, on the left, I want to print all the document children ...

Simple PHP CMS as an alternative to hacking Wordpress

For creating common user modifiable site I ve been forcing Wordpress to do the work of a CMS. It s worked and the back-end is purdy but it s just too hacky for my tastes. So I d like a simple CMS that ...

Modx assign default date to template variable

I have a template variable of input type date but I d like to have a default value of the current date at the time the document was first saved. I ve noticed that using the date formatter widget ...

热门标签