In all old versions of umbraco I was able to create a template without it being attached to a document type and a node and still being able to access it via domain.xx/
I do not, we used that feature a ton for various things and its much more polished than having the altTemplate query string in the URL. I know you could hide it with a rewrite rule but that's kind of a pain also.
"RoboDot" who started that issue commented that they'd tested it and it worked, maybe reach out to them?
I don't have a lot of experience with writing Composers.
but the gist is when Umbraco boots up, it has these 'collections' of different configurations/functionality that 'compose' an Umbraco application.
It's possible during this boot up, to add or remove items from these collections...
You can achieve this by creating a c# class file in your project that inherits from a special interface called IUserComposer... Umbraco will look for any c# class that implements this interface during start up and call the 'Compose' method on the class... it's in there that you can do your customisations eg in the case of ContentFinders there is a 'ContentFinderCollection' (see https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/IContentFinder)
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web;
using Umbraco.Web.Routing;
namespace My.Website
{
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class UpdateContentFindersComposer : IUserComposer
{
public void Compose(Composition composition)
{
//add our custom MyContentFinder just before the core ContentFinderByUrl...
composition.ContentFinders().InsertBefore<ContentFinderByUrl, MyContentFinder>();
//remove the core ContentFinderByUrl finder:
composition.ContentFinders().Remove<ContentFinderByUrl>();
//you can use Append to add to the end of the collection
composition.ContentFinders().Append<AnotherContentFinderExample>();
//or Insert for a specific position in the collection
composition.ContentFinders().Insert<AndAnotherContentFinder>(3);
}
}
}
That enables you to add / remove the individual ContentFinders that implement the rules that process the incoming Url..
The suggestion on the github link is to add the ContentFinderByUrlAndTemplate content finder back into the list of ContentFinders()
Alternativ template
In all old versions of umbraco I was able to create a template without it being attached to a document type and a node and still being able to access it via domain.xx/
Issue here: https://github.com/umbraco/Umbraco-CMS/issues/5290
So I'll have to write a composer to get this feature back :-/
Do you know if anyone already has done this?
I do not, we used that feature a ton for various things and its much more polished than having the altTemplate query string in the URL. I know you could hide it with a rewrite rule but that's kind of a pain also.
"RoboDot" who started that issue commented that they'd tested it and it worked, maybe reach out to them?
I don't have a lot of experience with writing Composers.
Thanks, yeah... I'm in the same boat as you - I'll see what I can find out and if anything usefull I'll update this thread.
Composing is a lot scarier than it sounds, and confusing because most of the terms begin with c...
Anyway there is a page in the docs here with examples:
https://our.umbraco.com/Documentation/Implementation/Composing/
but the gist is when Umbraco boots up, it has these 'collections' of different configurations/functionality that 'compose' an Umbraco application.
It's possible during this boot up, to add or remove items from these collections...
You can achieve this by creating a c# class file in your project that inherits from a special interface called IUserComposer... Umbraco will look for any c# class that implements this interface during start up and call the 'Compose' method on the class... it's in there that you can do your customisations eg in the case of ContentFinders there is a 'ContentFinderCollection' (see https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/IContentFinder)
That enables you to add / remove the individual ContentFinders that implement the rules that process the incoming Url..
The suggestion on the github link is to add the ContentFinderByUrlAndTemplate content finder back into the list of ContentFinders()
to have the V7 functionality back into play for nice urls for AltTemplates!
regards
Marc
is working on a reply...