Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.45 KB

File metadata and controls

36 lines (25 loc) · 1.45 KB
< 4. Kickstarter    |    Index

6. Preview Mode

The PresentationObjectComponent has a special flag to change its behavior when used with tools like Sitegeist.Monocle.

Sitegeist.Monocle uses dummy data that is read directly from an annotation within the component code. That data ends up being a plain PHP array, that does not implement the desired interface. The PresentationObject enforcement would thus break Sitegeist.Monocle's component preview.

When the flag isInPreviewMode ist set to true, the default props context is folded into the presentationObject context and the PresentationObject enforcement is deactivated.

This allows seamless use with tools like Sitegeist.Monocle.

EXAMPLE: Root.fusion

prototype(PackageFactory.AtomicFusion.PresentationObjects:PresentationObjectComponent) {
    isInPreviewMode = ${request.controllerPackageKey == 'Sitegeist.Monocle'}
}

The above example shows how isInPreviewMode can be set to true for all PresentationObjectComponents that are rendered in Sitegeist.Monocle. If you only want compatibility with Monocle, just copy the code above and paste it to your Root.fusion


< 4. Kickstarter    |    Index