# Sticky header shows up in block images

**URL:** <https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268>\
**Category:** Questions\
**Tags:** litium-8\
**Created:** [October 26, 2021, 6:53am UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268 "2021-10-26T06:53:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/johan/32/357_2.png) [@Johan](https://forum.litium.com/u/Johan)\
**Post date:** [October 26, 2021, 6:53am UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268/1 "2021-10-26T06:53:34Z")

</div>

Hi,

The block images generated in Litium backoffice all include the header (position: sticky), how can I prevent the header to show up in every block image?

Litium version: 8.0.0

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [October 26, 2021, 8:13am UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268/2 "2021-10-26T08:13:59Z")

</div>

Is it only on global blocks or local blocks too?

---

<div class="post-metadata">

**Author:** ![Johan](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/johan/32/357_2.png) [@Johan](https://forum.litium.com/u/Johan)\
**Post date:** [October 26, 2021, 8:21am UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268/3 "2021-10-26T08:21:13Z")

</div>

@ton.nguyen its for both global and local blocks

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [October 26, 2021, 8:56am UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268/4 "2021-10-26T08:56:02Z")

</div>

Something that you can hide if the request _is in administration_?

---

<div class="post-metadata">

**Author:** ![Johan](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/johan/32/357_2.png) [@Johan](https://forum.litium.com/u/Johan)\
**Post date:** [October 26, 2021, 11:39am UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268/5 "2021-10-26T11:39:48Z")

</div>

Yes, I guess, but that would also hide it in the backoffice preview? Is it possible to only target the screenshot capture?

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [October 26, 2021, 2:31pm UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268/6 "2021-10-26T14:31:45Z")

</div>

Maybe the stickiness could be conditional on `IsInAdministration`? So the header would show, but not be sticky.

Another option might be to remove the element dynamically in the JavaScript that takes the screenshot. This change is done manually in the NodeServices folder and would be overwritten with each new release of Litium though.

```auto
if (request.request.blocks) {
	const header = await page.evaluate(() => {
		let element = document.querySelector("header");
		element.parentNode.removeChild(element);
	})
	
	for (const blockId of request.request.blocks) {
		const elementHandle = await page.$(`[data-litium-block-id="${blockId}"]`);
		...

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [November 23, 2021, 2:32pm UTC](https://forum.litium.com/t/sticky-header-shows-up-in-block-images/2268/7 "2021-11-23T14:32:12Z")

</div>

Closed on November 23, 2021, 2:32pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
