Details
-
Improvement
-
Resolution: Done
-
Neutral
-
None
-
None
-
None
-
None
-
-
Empty show more show less
-
Yes
-
DevX 15
-
3
Description
A developper exploring and learning about Magnolia SPA will read https://docs.magnolia-cms.com/headless/spa-development/SPA-hosting.html#_externally_hosted_spa but will not learn about the best practice of configuring the baseUrl and routeTemplate on a site templatePrototype.
It would be helpful for them to learn this as a next step.
proposal
It can be a good practice to put the baseUrl and routeTemplate properties in the site templatePrototype, instead of in the template definition files. Remember, any properties in the site templatePrototype are applied to every page template in the site.
The key benefit is that you don't need to maintain the baseUrl and routeTemplate in all of your page templates, you can just maintain them in the site templateProtoype.
If you have multiple sites, this is very helpful as it allows you to reuse your page template definitions across all of your sites.
Example of a site configuration with an inline templateDefinition.
Link to the site / multisite documentation.
Other changes that I would recommend.
Make a whole new section for Nextjs, not as a subsection of "Connecting an external SPA"
Change from CAUTION to INFO, this section: "For an external SPA, use spa as the value of the $type property in your page template definition......"