I'm mulling an idea where I would have a set of 5 very similar document types which shared almost all the same properties (mainly by virtue of using Composites) and a strongly typed model which could map to all the different very similar document types.
There would in fact be only one property different between the documents but it would need to use a different data type, also these document types are valid in different places in the content tree.
I want to have a custom controller for these but because the naming convention is based upon the name of the document type it seems I would have to have 5 identical controllers. Is there any way to avoid this? Can a controller in some way be applied to more than one document type?
Many document types, one controller
I'm mulling an idea where I would have a set of 5 very similar document types which shared almost all the same properties (mainly by virtue of using Composites) and a strongly typed model which could map to all the different very similar document types.
There would in fact be only one property different between the documents but it would need to use a different data type, also these document types are valid in different places in the content tree.
I want to have a custom controller for these but because the naming convention is based upon the name of the document type it seems I would have to have 5 identical controllers. Is there any way to avoid this? Can a controller in some way be applied to more than one document type?
Perhaps you could have a single base class and 5 appropriately-named classes (which are largely empty) that inherit from it?
Other than that, I think you could implement a custom route - https://our.umbraco.org/documentation/Implementation/Custom-Routing/
is working on a reply...