Uploaded image for project: 'Hippo Site Toolkit 2'
  1. Hippo Site Toolkit 2
  2. HSTTWO-3747

Render meta-data for CMS to identify head contributions

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.0
    • Component/s: None
    • Labels:
      None
    • Similar issues:
    • Story Points:
      0
    • Processed by team:
      Tiger
    • Sprint:
      Tiger Sprint 135, Tiger Sprint 136

      Description

      The new channel manager does many component rendering calls to re-render components and containers in a page. However, components may add scripts and styling in head contributions that need to be loaded/executed before the component works. An example is a 'Carousel' component that needs certain JavaScript and CSS to work.

      When such a 'rich' component is added to a container on a page it does not work in the new channel manager. That's because it only reloads the container the component was added to via a component rendering call, and not the whole page, so the head contributions required by the new component are never rendered.

      The first attempt to fix this was HSTTWO-3743, which introduced a meta-data boolean in a component rendering response that indicated whether the HST has seen unprocessed head contributions or not.

      The problem with that solution is that the CMS cannot know which head contributions have already been rendered. That means that, for example, a new second Carousel component on a page will still indicate unprocessed head contributions even if the first Carousel already rendered all contributions. Also, head contributions may only be rendered after certain parameters have changed (e.g. after the first required Banner document of a Carousel has been selected). With only a single boolean, the CMS would have to reload the whole page each time any component is re-rendered. That will become too much.

      To fix this, a normal HST rendering call by the CMS should include additional meta-data in the response that lists all head contributions that have been rendered. Each head contributions can be identified by, for example, a hash of its content (that saves complex HTML and JSON escaping of the real content). For example:

      <!-- { "type": "HST_PROCESSED_HEAD_CONTRIBUTIONS", "ids": ["12345", "67890"] } -->
      

      In addition, a component rendering call by the CMS should include meta-data in the response with a list of head contributions that have not been rendered. For example:

      <!-- { "type": "HST_UNPROCESSED_HEAD_CONTRIBUTIONS", "ids": ["35792"] } -->
      

      The CMS can use these meta-data to see whether a component rendering call introduces a head contribution that has not been rendered yet. Only in that case it can choose to reload the whole page instead of replacing a part of the DOM.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mdenburger Mathijs den Burger (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: