Uploaded image for project: 'Magnolia pages module'
  1. Magnolia pages module
  2. PAGES-1226

Make it possible to get subpath in site-aware SPA router

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 6.3.0, 6.2.31
    • None
    • None
    • None

      If the site is defined for .e.g prefix /path/to/site, then in the `routeTemplaate` a new  property/variable:  `{{@sitePath}}` should return only the subpath

      ie:  `/path/to/site/sub/path` → `/sub/path`

      This would make it convenient for the frontend/SPA developer as the URL loaded in the Page Editor would be  the same to how it is loaded in the production frontend.

      Note:

      Keep in mind that even in the non-site context, frontends also need to usually handle two different routes, one for preview, and one for production. Consider the "react-minimal" demo project. For both of these URLs:

      The SPA makes a delivery request to the full path http://delivery/react-minimal

      Context

      See: https://magnolia-cms.slack.com/archives/C02JTLP0CPP/p1686240443967409

       

      Workaround:

      The frontend app / SPA, can have routing logic to handle the the URL with the full path. (There might be situations where this is tricky.)

       

        Acceptance criteria

              rdhar Rishab Dhar
              rsiska Robert Šiška
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started:

                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 3.5h
                    3.5h