3 min read
Dynamic Content
Available from SS24Dynamic Content is an exiting new technology that we hope to eventually replace most or all of the SDK. Dynamic Content is our first SwiftUI feature and is itself it's own architecture for building features by composing components.
Dynamic Content can be presented anywhere as a page or within a predefined Slot and is managed via our App Manager web tool.
Deeplinks
# Present content as a page.content/{id}?title={title}
Replace id
with the Dynamic Content identifier and title
with a good page title (optional).
You can copy the deeplink, or simply scan the QR code, for content on App Manager.
Set Up
Dynamic Content requires no code, only for the developer to link the PoqUI
framework.
Slots
Some features have predefined Slots, filled from the slotContent
of their associated BE response data.
Slots are easy to add to any feature that supports slotContent
, or using a custom data solution, to provide their content dynamically.
Slots are views that can be added anywhere in a view hierarchy to provide an area for dynamic content.
Over time we will roll out slots to more of the SDK features or even build entire features from them. Check feature specific documentation for the SDK predefined slots.
Generally slots are added to vertical layouts with no fixed sizes. If a slot has no content, or fails to resolve content, it collapses to zero size, hiding itself.
Slot content should have an implicit size; stacks have an implicit size based on the size of their stacked components. However, scrolls and some containers do not have an implicit size as they fit themselves to the size of their container whilst their content is less than or extents beyond their own size.
Putting content with no implicit size in a slot can lead to a zero height slot (the content not showing).
Slots size themselves based on their content. Depending on the content and scenario this can cause interesting (good or bad) animations which can be improved by ensuring components that have size or aspect ratios have them set correctly.
Components
Components make up Dynamic Content. They are parts of your apps UI that can be composed to make other components, content and screens.
For example, a blog post is likely to consist of a title, hero image, then sections of text and images. We can represent this as the following composed component heirarchy and serve it as Dynamic Content:
- Vertical-Scroll
- Image
- Text
- Spacer
- Text
- Text
- Horizontal-Stack
- Text
- Image
- Text
- Product-Carousel
In the above you can see how you can nest horizontal-stacks to split content and even add other components such as a product carousel to allows users to browse the products mentioned in the content above it.
This Dynamic Content would be saved as a single component (the Vertical-Scroll that owns the rest) and then exposed to your users by deeplinking to it from banners or anywhere else in your app.
Components are JSON, so creating your own component is easy. Follow the tutorials in the PoqSDK docs bundle for the PoqUI framework to implement them.
Actions
From SS25, components can use Dynamic Actions to execute logic such as navigating via deeplinks or tracking analytics events.
Triggers such as onTap
replace the previous link
properties of some components.
Actions have access to the current context and can be designed to update other components or create forms. This unlocks the ability to create more complex screens from dynamic content.
Dynamic Yield
You can use Dynamic Yield to return content set up directly within Dynamic Yield.
The FE integration handles tracking directly with Dynamic Yield and adds a header to all network requests that BE middleware intercepts to return content for slots.
Slot content can be returned from multiple sources where the order of priority is determined by the order of the BE middleware; generally if Dynamic Yield can return content, it would override content set in App Manager.
History
- SS25: Added new slots, components, actions and context.
- AW24: Added new slots and components.
- SS24: Full initial release with base set of components.
- v25: Limited release with Dynamic Yield integration for slots.