Relatude Help

Rendering and routing

  • Layout variants of one type need a template on every page. When two templates list the same type, a page that chooses neither is ambiguous, and a request for it fails.
  • A template beats a code default only when it is as close. A template for IPage does not take over articles that have RenderRazorView<IArticle>(); a template for IArticle does.
  • View, controller and Razor Page names are checked at start, not on save. After renaming one, read the log.
  • A page with nothing to render it is not rendered. It falls through to MapFallback or a 404, like a URL with no content.
  • Explicit routes beat content. app.MapGet("/search", …) hides a page with the address search.
  • Controllers that render content are conventionally routed. A controller that an MvcControllerTarget names has no [Route] and no [ApiController].
  • File URLs need MapRelatudeCMS(). A site that also routes another system maps that router beside it, never in its place (chapter 7).
  • Routing runs before authentication. In a route transformer of your own, call await cms.AuthenticateAsync() on RelatudeCmsContext before asking ContentResolver anything, as the CMS's own transformers do. Otherwise the request can be resolved as an anonymous visitor.