Tutorial: Landing Pages & GDPR — Blazor
Blazor's IsabyteLandingPage has its own, independently-modeled GDPR settings (GdprPopupSettings)
plus a built-in save pipeline — richer than the shared cross-tech engine the other five techs consume.
Package: Isabyte.PowerTools.Blazor.
Step 1 — Enable the GDPR Popup (landing-page)
Inside the editor, open Project settings and tick GDPR popup. It exposes RenderLocation,
ConsentCategories (Necessary/Functional/Analytics/Marketing), FrameworkBadge
(DataPrivacyFramework/IsoIec27701/IabTcf/IcoUk), ExternalProvider
(None/OneTrust/CookieBot/CookieInformation/Ecomply/TrustArc/HubSpot), and ConsentEventName.
Step 2 — Listen for Consent on the Public Page
const consent = window.isabyteConsent.getConsent();
if (consent?.categories?.analytics) { /* fire your analytics pixel */ }
window.addEventListener("isabyte-consent-changed", e => {
if (e.detail.categories.marketing) loadRemarketingTags();
});
Step 3 — Capture the Editor's Save Bytes
@using Isabyte.PowerTools.Components.Tools
@inject ILandingPageStore Store
<IsabyteLandingPage @bind-Value="_project"
Mode="LandingPageMode.Edit"
SaveMode="LandingPageSaveMode.Both"
OnSave="HandleSave" />
@code {
private LandingPageProject? _project;
private async Task HandleSave(byte[] bytes) => await Store.SaveAsync("home", bytes);
}
Step 4 — Persist to Disk or Azure
public sealed class DiskLandingPageStore : ILandingPageStore
{
public async Task SaveAsync(string slug, byte[] bytes)
=> await File.WriteAllBytesAsync(Path.Combine(_root, $"{Path.GetFileName(slug)}.isal"), bytes);
}
Swap in an AzureLandingPageStore backed by Azure.Storage.Blobs for multi-server/CDN-fronted
deployments — same interface, different implementation, registered in Program.cs.
Step 5 — Serve Publicly
<IsabyteLandingPage Value="_project" Mode="LandingPageMode.View" ReadOnly="true" />
Keep editor routes behind [Authorize(Roles="Editor")] and viewer routes anonymous.
Common Gotchas
- Sanitize slugs before joining paths — run untrusted slugs through
Path.GetFileNamebefore composing a file path. - Blazor's
GdprPopupSettingsis its own model — richer than the cross-techgdprschema the other techs share, so don't expect a byte-identical export from a Blazor-authored popup versus the shared engine's.