--- title: Displaying banners description: Show a banner's hosted HTML in a sandboxed frame on your page, keep its area stable, and design one banner that fits several areas. slug: merchandising/business-rules/displaying-banners docKind: guide hub: luigisbox-ai --- A banner with `html` comes back in a [search or collection response](/merchandising/business-rules/banners/#banners-in-the-response) as `html_url`: a page we host on your organization's own subdomain of `eu1.luigisboxusercontent.com`, such as `https://lbo-r2vn8c.eu1.luigisboxusercontent.com/banners/lbbn_7h3k9w/6f9d71fd2279e42d….html`. Show it in an ` ``` ```css .banner-area--above-results { aspect-ratio: 6 / 1; } .banner-area iframe { display: block; width: 100%; height: 100%; border: 0; } ``` - Give each area a fixed size in your layout. The page cannot resize its frame, and an area sized in advance keeps the results from moving when the banner loads. - The `sandbox` attribute repeats the isolation our server already sends with the page, so the banner stays isolated however the frame is set up. - `title` names the frame for screen readers. `loading="lazy"` suits areas below the fold. - Render the area only when `banners` holds a banner for it. An empty `banners` list, or no banner for an area, means nothing shows there. A frame reports no error when its page fails to load, and the page cannot report it to yours: the frame stays empty in its reserved space. This happens when: - your page sends a `Content-Security-Policy` whose `frame-src` or `child-src` does not allow `https://*.eu1.luigisboxusercontent.com`; - the banner is archived while a shopper pages through results that were chosen before; see [Archiving](/merchandising/business-rules/banners/#archiving). ## What runs inside the frame The page is served with a `Content-Security-Policy` sandbox, so the browser isolates it: - Its scripts run. - It has no cookies and no storage: `localStorage`, `sessionStorage` and IndexedDB are not available. - It cannot read or change your page, and your page cannot read it. - A link with `target="_top"` opens in your page's tab when the shopper clicks it, and one with `target="_blank"` in a new tab. A link without a `target` opens inside the frame, so give every link one. Without a click, the frame cannot navigate your page. - Forms cannot be submitted. - Camera, microphone, location and payment are blocked. - Any `https:` page can show it in a frame; an `http:` page cannot. ## One banner for several areas A wide strip above the results and a square tile in the grid can show the same banner, each through its own campaign rule. Media queries inside the frame see the frame, not the browser window, so one page can choose its picture by the shape of the area it is shown in: ```html Northwear autumn: 30 % off ``` Upload `strip.jpg`, `tile.jpg` and `card.jpg` with the banner; each `lbx-image:` name is replaced with its image's URL. See [Images](/merchandising/business-rules/banners/#images). ## Language A search or collection response ends each `html_url` with the catalog's language as a fragment, such as `…/6f9d71fd2279e42d….html#language=de-DE`, as a BCP 47 tag: the form `Intl` and HTML `lang` take, so a catalog whose `language` is `de_DE` gives `de-DE`. Keep the fragment when you put the URL in the frame, or set it to another language your page shows. It never reaches our server, so a banner shown in several languages loads one cached page. A script inside the banner reads it from `location.hash` and shows the matching text: ```html

Autumn sale

``` Without a script, the banner shows the same text in every language. The `html_url` that `/platform/v1/banners` returns carries no fragment. ## See also - [Banners](/merchandising/business-rules/banners/) — creating a banner and showing it through a campaign - [Search](/discovery/search/) and [Collection](/discovery/collection/) — the responses that carry banners