With the upcoming FCKEditor there will be a Content Template plugin that allows the user to use a predefined tempate as a layout base for the content.
Here's what I would like to propose:
1) Currently we now use a Template to define how a page on the web layed out. Let's call this template the master template or Page Tamplate (PT)
2) We can add a field to the site_templates table to determine the additional types of templates. This would allow us to now create newer kinds of templates like Content Template and Form (or Input) Templates
3) A Content Template (CT) is used to layout a specific content on a page. A page can have more than one content areas with each content using a separate content template
4) An Form Template (FT) is used to layout the form fields (or TVs) used to enter data inside a document. This would allow the user to Design special document forms that will ony show selected fields or TVs. In other words it can be used to rearrange the form fields inside the mutate_document screen.
What do you think?
I think I follow, and if so then YES! The only question I have is aren't page templates and content templates really the same thing? I mean, does there need to be a distinction? Page templates are just templates with <html>, <title> and the enclosing <body>, etc.
Well yes they are very similar. My reason for wanting to keep them separate it to prevent users from using a page template with the <html> <body> tags to layout the content.
As for form/input templates, I'm obviously on board with this, given my previous post on the subject: http://vertexworks.com/forums/viewtopic.php?t=74
cool
Any other thoughts
-
MODX Staff
- 12,272 Posts
Very cool idea Raymond. The CT/PT distinciton is great. In fact the TVs should be linked to CTs and not PTs. I like the FTs, too.
However, I really like what Dave said too in that a template is a template is a template. Folks are gonna get confused with at the xTs lol
So we got our templates that can be for pages, parts of pages or forms. They're just templates. And we still got our Template variables. They can be public by default, meaning all templates could use them UNLESS specificallly otherwise restricted.
So how do we access these different templates within templates? As we talked about a while ago, how about via the content variable. So to access a "content" template for a shopping cart catalog page named "catalog", you might call keep with our @bindings (which if anyone hasn't really started to learn and understand those, you're really missing out) [*content@catalog*] in the template.
How does this sound?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Yes, they are all templates and will be stored under the Template Resource but we use the PT, CT and FT keywords to differenciate one type of template from another.
In other words this should make things simplier for users.
The PT type is a special template that is used to layout the webpage but cannot be applied to a content or to an input form. Changing this template will change the layout of all the documents that are associated with this template.
The CT type is a special template that gets inserted into a document's content when selected. It provides the user with a predefined layout for entering html, etc. Changing a CT will not affect existing documents that are using that CT. It will only affect new documents. This is the way how FCK's cntent template plugin works. The CT is copied inside the editor so the user can custmize it or just fill in the blanks. CTs should not be used to layout a web page or an input form. CTs can only be inserted from a Richtext editor.
The FT type is similar to the PT type but should only be applied to input forms.
Maybe we should make FTs and CTs children of PTs and change their names to Conent Layout and Form Layout? In other words When you select a template you will have the option of choosing a Form layout for data entry or a Content Layout from the RichEditors
Any thoughts?
-
MODX Staff
- 12,272 Posts
I definitely don't like the idea of tying anything as a requirement of using the Rich Text Editor.
I also don't like the idea of an update to a template not being reflected in every page that it's used in. Can you help me understand the purpose of that?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
I definitely don't like the idea of tying anything as a requirement of using the Rich Text Editor.
Well it could be made to work with Textboxes as well but the user would have to work with the html tags
I also don't like the idea of an update to a template not being reflected in every page that it's used in. Can you help me understand the purpose of that?
Firstly the content of a document must be saved as a whole. Currently it's not saved in segmented blocks of code. This is why we cannot merge a document's content with the content template in the same way we can a document with a page template.
See FCKEditor new's Template plugin from the FCK website
Ryan,
In addition, CTs are used the same way MS word usings templates. It's only applied once. Changing template will not change the content after it has been applied or inserted into the document.
Agree/understand?