Using a composition as page template
# help-with-umbraco
v
The way I understood compositions is that they can be used as a sort of template for other document types. So I created one but seem to be unable to use it. This composition has some of it's own fields and some element type fields. My issue is that I cannot find the composition page I created when pressing "Compositions" in my other documents, I just find "regular" documents that are not compositions
a
So you want to use "artikel" as a compostion on another page? I'm not sure that that's possible (i could be wrong as i havent tested it). Maybe remove the compositions added to "artikel" and on the implementing page have the "metadata", "bilder" and the new "artikel" composition instead
v
I ended up using element types instead. They work but are a hassle because you cannot set the order they are shown with. I guess my editors have to work with random order of elements on pages so that I can re-use page types 🤷‍♀️
s
You can.. 💡 the hack is to set the sort order to like 10, 20, 30 on your base doctype and then 21, 22, 23 on the element type.
v
Cool trick @Sebastiaan ! But my professor told me "always use re-usable things or your life will become hard" So all my document content is elements types, I can't re-order any of them except whatever I added to that specific page. There is probably some good technical reason for this, but as a novice end user it is a bit annoying ): EDIT: Oh wait I just needed to read your post again, that works! It's a bit hacky but now I can controll which elements come first, fantastic! 🙌👏 Thanks 🙂 Edit again: It seemed to work, but I was too fast. I set the order to 10, 20 and 30 But number 30 is showed first, then 10, then 20. So it seems like the order did not change how things appear in back office
a
Maybe save & publish the document types ? I regularly use the method Sebastiaan posted, with no issues 🤷‍♂️
And ehh I know sebastiaan calls it a hack, but I would argue it's not a hack but a technicality. using composition it's implementing all the properties as they are defined in the "base"/"interface" or what you would call it. If they define a certain sort order that has to be respected. Ofc it's annoying you cannot set it granuarly, but it's also nice you can control it in one place in the base. IE if 20 document types use that compostion you ideally only have to set it up one place instead of 20,
s
Yeah it's a solution many people use, so I'd encourage you to try some more! Should be possible. You're right, not really a hack (it's a supported scenario), but it would be nicer if you could "just" reorder on the doctype and have it save that sorting locally on the doctype instead of having to rely on using increments of 10 on a master doctype. One day.. 🙂
2 Views