Uploaded image for project: 'Magnolia Frontend Helpers'
  1. Magnolia Frontend Helpers
  2. MGNLFE-230

DOC: Describe why and how to use site prototype for External SPA

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Done
    • Neutral
    • None
    • None
    • None
    • None
    • 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......"

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              mdrapela Martin Drápela
              czimmermann Christopher Zimmermann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD