Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-4274

Enhance link support in page model api content

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.3.0
    • None
    • None

    Description

      The page model api response must support in the content link with which an SPA can work. The information an SPA needs contains 2 parts

      1. How to construct a URL from the link
      2. Can the SPA invoke the link as an XHR call or should it be a document request (aka normal webpage request)

      So, first of all, we need to expose a link. rkauffman indicates having a link relative to the parent mount of the resourceapi is what he needs. From that link, he can always create the resourceapi link himself since he already does this. This means we need to expose something like

      _links: {
        site: "/site/spa-hap/news/2015"
      }
      

      for content element

      However, this is not enough. Namely, in an SPA, you also want to know whether the link can be constructed to be an XHR call (within the same SPA) or whether the link is a link outside the current SPA, and thus requires a complete document request (normal webpage request).

      Since we plan to also support for a single channel to have multiple SPAs and/or normal rendered webpages, we need to know to which SPA the resolved sitemap item for the link belongs. If it turns out that it belongs to the same SPA as the current request, the link can have some other boolean indicating this, for example

      _links: {
        site: "/site/spa-hap/news/2015"
        type : 'internal'
      }
      

      where 'internal' would mean the site link is available within the current SPA. Other values can be 'external' or 'resource' (the latter for a binary which can be accessed with the SPA but also outside the SPA AFAIU)

      Note that I will also always include the _self link implying the link for the current matched mount. Thus the complete output would be something like

      _links: {
        self: "/site/resourceapi/spa-hap/news/2015"
        site: "/site/spa-hap/news/2015"
        type : 'internal'
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: