Closed RobK073 closed 5 years ago
You can still use ?altTemplate=TemplateName
- not sure if we are going to support the other method where the template name is added to the URL, I'll ask around.
Heard back: this is still supported if you must, you can do composition.ContentFinders().Append<ContentFinderByUrlAndTemplate>()
in a composer.
The way altTemplates and routing are handled is a bit odd and convoluted so we're not enabling it by default so as not to encourage it too much.
Hi Sebastiaan,
Thx, that is what I m looking for. I have tested it and it works :)
@RoboDot can you post an example of how to implement this? or @nul800sebastiaan is there any documentation about how to achieve this?
was a useful feature in v7 and would be good to know the best practice for enabling it in Umbraco 8
@nul800sebastiaan should this be documented ?
The ability to manipulate the list of ContentFinders in a composition is documented:
https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/IContentFinder
but not the change to the default behaviour of altTemplate (but I sort of think that wasn't 'documented' in V7 either... but more part of Umbraco folklore (we used to cover it in the L2 training though) so it is going to surprise folk could add a note to the IContentFinder docs page above to that affect!
have added an example on the forum post: https://our.umbraco.com/forum/using-umbraco-and-getting-started/99794-alternativ-template
In the previous version (7) I could route my (template)page by a TemplateName. If I do the same thing in 8, umbraco returns a 404.
Reproduction
In 7 I created a DocumentType with 2 or more templates. If I created a contentpage based on this documenttype I could give the templatename with it like this www.example.com/myPage/TemplateName and it returns the right template. In 8 this isn't working anymore, I get a 404. I used this before to acces my CRUD templates so it was very easy.
I have everything retested with a clean 7 and a clean 8 installation without starterkits.