Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthew 138 posts 201 karma points
    Apr 18, 2015 @ 04:32
    Matthew
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 18, 2015 @ 09:17
    Jan Skovgaard
    1

    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

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 18, 2015 @ 09:24
    Dennis Aaen
    0

    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

  • Matthew 138 posts 201 karma points
    Apr 18, 2015 @ 19:39
    Matthew
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 18, 2015 @ 19:51
    Jan Skovgaard
    0

    Hi Matthew

    Happy to hear it made sense to you now.

    Happy "Doctyping" :)

    /Jan

  • William Charlton 171 posts 218 karma points
    Aug 12, 2015 @ 09:21
    William Charlton
    0

    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?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Aug 12, 2015 @ 09:55
    Dennis Aaen
    0

    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

  • William Charlton 171 posts 218 karma points
    Aug 12, 2015 @ 11:11
    William Charlton
    0

    Thanks Dennis,

    So essentially it is the same as nesting a page and using [recursive: true] as in:

    @Umbraco.Field("footerText", recursive: true)

    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?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Aug 12, 2015 @ 11:33
    Dennis Aaen
    0

    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

  • William Charlton 171 posts 218 karma points
    Aug 12, 2015 @ 12:00
    William Charlton
    0

    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?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Aug 12, 2015 @ 12:09
  • William Charlton 171 posts 218 karma points
    Aug 12, 2015 @ 13:48
    William Charlton
    0

    Excellent, that is just what I wanted. It never occurred to me to search for info on Master Pages!!

    Thanks Dennis ;)

Please Sign in or register to post replies

Write your reply to:

Draft