how/where do i create a document type composition?
I'd like to play with this feature but don't see how to do it. When I create a document type, the compositions section pre-checks all the parents and won't let me uncheck any of them, nor add anything but parent document types.
I thought the point was to be able to create separate doctypes and add or omit them. Is there somewhere you're supposed to turn this functionality on?
Document type compositions are simply just documentypes that you can use on other document types so you can have for instance a "SEO" document type composition that you can set your document types that represents pages to inherit the SEO tab from.
However if you create structure of nested document type compositions you currently won't be able to choose them unfortunately.
So if you have made a document type structure like the below then you will only be able to select the "Compositions" document type since children of document types currently can't be selected.
Pages - Homepage - Textpage
Compositions
- SEO
- Content
- Settting
So perhaps it's an idea to simply prefix your compositions with an underscore and then have a flat hierachy of those so the above structure will look like this
Pages
- Homepage
- Textpage _SEO _Content _Settings
Then you should be able to choose these document types named with the underscore on your "Hompage" and "Textpage".
It's not ideal but that how it currently works - But hopefully we will have folders so we can better organize things in the future. Think that might be part of the plans for v8 if I remember correctly.
I am currently working on a project where I am using document type composition for the first time I am think it works very well.The way we did it is by create a normal document type, and we are using the convention if its a document type composition we have prefixed it with underscore first. All our document type composition donĀ“t have any masters document type they are just in the structure.
For example you can have a document type composition for SEO fields, navigations fields and content fields. After you have created the document type compositions, then you create your e.g textpage document type and in the structure tab you can choose which document type compositions the textpage document type should inherit fields from.
Ah, I see, thanks folks. I had been trying to put them under my 'RootDocType'.
This makes sense, keeping doctypes to be used as compositions separate from an inheritance tree. Metaphorically, they are ornaments that may be placed on the tree but are not essential to the tree, so are kept outside the tree.
I have just installed a new 7.2 website and am looking at Document Type Compositions. I can't find any documentation on how to build the template for a child page. Is there any?
Document Type Compositions is just regular document types, so you just create one document type I have seen this being prefixed with _ so you can see what is a composition and what is normal document types.
When you have create the document type composition add the fields for it and you should now see on under the document compositions.
Then you can add these composition on other document types and it will get the fields from it. Under the structure tab.
The compositions is the same as the old Master document type. The advantage here is that you do need to recreate the whole document type structure if a field.
Or if you are thinking this document type for this page should have the SEO fields and another one should not. And after some time you will like to add the SEO to the page.
Yes, I have seen that page but I can see no way to inherit child content without duplicating the whole page of HTML in both "parent" and "child".
In the old master pages you could just add a contentplaceholder in the master page and then in the child page/template just have say a div.
That way the parent inherited the child content and placed it in the placeholder.
With compositions I can see that the doc type elements (for example a text field for News) can be included (from another doc type) but the template for the child page still has to have all the same HTML of the parent.
How can I include the child page content in the parent, am I missing something?
how/where do i create a document type composition?
I'd like to play with this feature but don't see how to do it. When I create a document type, the compositions section pre-checks all the parents and won't let me uncheck any of them, nor add anything but parent document types.
I thought the point was to be able to create separate doctypes and add or omit them. Is there somewhere you're supposed to turn this functionality on?
Running 7.2.4
Thanks much.
Matthew
Hi Matthew
Document type compositions are simply just documentypes that you can use on other document types so you can have for instance a "SEO" document type composition that you can set your document types that represents pages to inherit the SEO tab from.
However if you create structure of nested document type compositions you currently won't be able to choose them unfortunately.
So if you have made a document type structure like the below then you will only be able to select the "Compositions" document type since children of document types currently can't be selected.
Pages
- Homepage
- Textpage
Compositions
- SEO
- Content
- Settting
So perhaps it's an idea to simply prefix your compositions with an underscore and then have a flat hierachy of those so the above structure will look like this
Pages
- Homepage
- Textpage
_SEO
_Content
_Settings
Then you should be able to choose these document types named with the underscore on your "Hompage" and "Textpage".
It's not ideal but that how it currently works - But hopefully we will have folders so we can better organize things in the future. Think that might be part of the plans for v8 if I remember correctly.
Hope this makes sense.
/Jan
Hi Matthew,
I am currently working on a project where I am using document type composition for the first time I am think it works very well.The way we did it is by create a normal document type, and we are using the convention if its a document type composition we have prefixed it with underscore first. All our document type composition donĀ“t have any masters document type they are just in the structure.
For example you can have a document type composition for SEO fields, navigations fields and content fields. After you have created the document type compositions, then you create your e.g textpage document type and in the structure tab you can choose which document type compositions the textpage document type should inherit fields from.
Hope this helps and make sense,
/Dennis
Ah, I see, thanks folks. I had been trying to put them under my 'RootDocType'.
This makes sense, keeping doctypes to be used as compositions separate from an inheritance tree. Metaphorically, they are ornaments that may be placed on the tree but are not essential to the tree, so are kept outside the tree.
Thanks very much.
Matthew
Hi Matthew
Happy to hear it made sense to you now.
Happy "Doctyping" :)
/Jan
I have just installed a new 7.2 website and am looking at Document Type Compositions. I can't find any documentation on how to build the template for a child page. Is there any?
Hi William,
Document Type Compositions is just regular document types, so you just create one document type I have seen this being prefixed with _ so you can see what is a composition and what is normal document types.
When you have create the document type composition add the fields for it and you should now see on under the document compositions.
Then you can add these composition on other document types and it will get the fields from it. Under the structure tab.
Hope this helps,
/Dennis
Thanks Dennis,
So essentially it is the same as nesting a page and using [recursive: true] as in:
I still have to repeat all the HTML in each template but can use the doc type elements from the added compositions?
How does one achieve the same as the old asp.net contentplaceholder trick?
Hi William,
The compositions is the same as the old Master document type. The advantage here is that you do need to recreate the whole document type structure if a field.
Or if you are thinking this document type for this page should have the SEO fields and another one should not. And after some time you will like to add the SEO to the page.
Then you simple can do that. Try to see this blogpost http://www.wiliam.com.au/wiliam-blog/umbraco-7-2-compositions
Hope this helps,
/Dennis
Yes, I have seen that page but I can see no way to inherit child content without duplicating the whole page of HTML in both "parent" and "child".
In the old master pages you could just add a contentplaceholder in the master page and then in the child page/template just have say a div. That way the parent inherited the child content and placed it in the placeholder. With compositions I can see that the doc type elements (for example a text field for News) can be included (from another doc type) but the template for the child page still has to have all the same HTML of the parent.
How can I include the child page content in the parent, am I missing something?
Hi William,
Try to see these to videos about templates in MVC
http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/using-master-templates/
http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/advanced-master-templates/
Hope this helps,
/Dennis
Excellent, that is just what I wanted. It never occurred to me to search for info on Master Pages!!
Thanks Dennis ;)
is working on a reply...