AEM Blogs x How-To's
${ AUTHORING MODE }
Latest post

How To Render Browser-Stored Content in the Authoring View
What if the content for your component is not in the repository? A visitor did something in the browser, the page wrote a cookie, and later a component has to turn that cookie back into markup. On Publish, JavaScript can populate the list after the page loads. In the AEM editor, though, I'd rather have the component render its content directly so authors can see what they're working with. When we save the dialog, we also need AEM to render the updated component. For this example, we'll refresh the editor page and let our Sling Model read the cookie again.
So what can we do?
We're going to look at how to build a component that stores IDs in a cookie. In edit mode it renders those IDs while the page is drawn. On Publish it leaves the first response alone and fills the list with a second request. Swap the IDs for whatever content you store: pages, products, locations, articles… The request split stays the same.
Featured Posts
Relationship of Template Types & Templates to Page Components
Understand how AEM links Template Types, Templates, and Page Components to control page structure, policies, and authoring behavior. Learn how each layer connects, where they live in the repository, and how they work together to define consistent, reusable page foundations.
How to Load AEM Dialog Clientlibs in the Create Page Wizard
Missing dialog functionality when creating a page in AEM? Learn how to include the `cq.authoring.dialog` category in CreatePageWizard using Granite UI.
AEM Package Manager: What's Actually Inside Those ZIP Files?
Learn how AEM packages are built, what's inside the ZIP files, how Maven modules and OSGi bundles fit together, and how deployment differs between AEM 6.5 and AEM as a Cloud Service.
