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

Fallback component to be used when component ID is not recognized

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.3.1
    • None
    • None
    • None
    • Yes
    • Yes
    • DevX 21, DevX 22
    • 5

      As a developer I always want existing content to be rendered in a page, even if the frontend component has not been built yet.

      As an author I would like to start entering content and seeing content, even if the developers have not yet provisioned the frontend component.

      Notes: 

      Supply a simple default fallback component in each of the frontend helper libraries that renders all of the root props it recieves (but not the metadata).

      This would be helpful during development - that the page just renders something even if I have not created a frontend component yet. It would also be useful when I make a mistake - such as not supplying the proper mapping configuration, or forgetting it, or making a TYPO - then at least I see that the content is indeed there.

      Rendering should be simple, for example.

       

      Template not found: my-light-module:/templates/components/booook 
      
      name: Gone with the wind.
      pages: 556
      description: Some kind of description about the thing I don't know what exactly.
      ISBN: 4848493938383
      category: [category uuid]

       

      In addition to the default fallback compoent, allow a developer to optionally provide their own fallback component.  Which one to use could be included in the 'config' object which is passed to EditablePage .

      const config = {  
        componentMappings: {    
          'nextjs-ssr-minimal-lm:pages/basic': Basic,    
          'spa-lm:components/headline': Headline,    
          'spa-lm:components/image': Image,     
        },
      
        fallbackComponent: MyFallbackComp,
      
      };
      
      

       

       

      AC:

      • Only is used during development or when authoring. Should not be displayed in production/published context. In that case nothing should be rendered.
      • Only is used when Authoring in PageEditor, when not in page editor then no fallback is rendered.
      • In the default component, only render root nodes, not subnodes - to prevent too much content from being rendered.

        Acceptance criteria

              plequoc Phong Le Quoc
              czimmermann Christopher Zimmermann
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 16d 0.75h
                    16d 0.75h